
(function (app) {
	try {
		console.log(app);
		app
		.controller("photo_mainCtrl",["$scope","myFactory",'$http','$stateParams','$interval','$state',"$q",'$timeout','$location','$ionicHistory',function($scope,myFactory,$http,$stateParams,$interval,$state,$q,$timeout,$location,$ionicHistory){
			//接收参数
			var itemId = $stateParams.itemId;//变更项目ID
			var chdrnum01 =  $stateParams.chdrnum01; //保单号
			$scope.chdrnum01=$stateParams.chdrnum01; //保单号
			var chdrcoy = $stateParams.chdrcoy; //保单公司号码
			var signMainData=$stateParams.signMainData;//用于返回

			$scope.photoMainData=$stateParams.photoMainData;
			var photoMainData = $stateParams.photoMainData;
			var strItemIds=photoMainData.strItemIds;
			//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf start
			var isSamePerson = $stateParams.isSamePerson;
			//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf end
			//页面数据
			$scope.photoRule=photoMainData.photoRule;
			var photoRule=photoMainData.photoRule;
			$scope.policy=photoMainData.policy;
			var policy=photoMainData.policy;
			$scope.holderIdDate=photoMainData.holderIdDate;
			var holderIdDate=photoMainData.holderIdDate;
			$scope.insuredIdDate=photoMainData.insuredIdDate;
			var insuredIdDate=photoMainData.insuredIdDate;
			$scope.benefiIdDate=photoMainData.benefiIdDate;
			var benefiIdDate=photoMainData.benefiIdDate;

			// S2023020825099 TX FaceID add by lvjg 20230625 start
			var idTypeAndCharge = photoMainData.idTypeAndCharge;
			var face_ow_name = idTypeAndCharge.ow_name;
			var face_ow_idno = idTypeAndCharge.ow_idNo;
			var face_lf_name = idTypeAndCharge.lf_name;
			var face_lf_idno = idTypeAndCharge.lf_idNo;
			console.log("face_ow_name:" + face_ow_name + ", face_ow_idno:" + face_ow_idno);
			console.log("face_lf_name:" + face_lf_name + ", face_lf_idno:" + face_lf_idno);
			// ##S2023020825099 TX FaceID add by lvjg 20230625 end

			var sysDate=photoMainData.sysDate;



			var content_id = "01" ;
			var mark=1;//图片层标识 自增长
			//var backTgt ="<%=backTgt %>"; //是否为下一个页面返回
			var timeOutPhoto="N";

			var policyHolderNum=photoRule.policyHolderNum;
			var policyHolderIDNum=photoRule.policyHolderIDNum;
			var insuredNum=photoRule.insuredNum;
			var insuredIDNum=photoRule.insuredIDNum;
			var benefiNum=photoRule.benefiNum;
			var benefiIDNum=photoRule.benefiIDNum;
			var bankNum=photoRule.bankNum;
			var otherNum=photoRule.otherNum;
			var token=sessionStorage.getItem("token");
			var tokenEndAuthorId="A";
			
			var maxTime = 500;//3*60;//倒计时时间
			var timer;
			//PC端测试数据
			var testVal="SUkqAHJzAACAPR2uV/Px+v4AP8BAICP+HAOIQ5/gGKACLReJPqNAaOACFxiHQwBv+Dxp9Ph9PmLhCWAMAgKLyCJgJ/wkBP6cRQAxYBMxnM0ZUGLgGIAGSRQBzh+UiEgF+wmcP4CgIBvyrAQC1WcASFtSvCkUCpzWMLhgLOFxuMJSyJBsPh+hgABzGPXS7Xe8AB8ShptBquJyuAJhEJPt/P1nsxltZstMHhEGjAVCILhwMAsDAgCgauRO7VGL1Z+SSov6JPt9vqJQ4AP3XTrXQfDxJ+v+o7a6wedQl+wsBbWEXd/uDGhHjUqEALOQ2Ha59gXoRAB66Sa7pSYEgsF6h9xeEQoAAF5eOL2NzCr0Tr1RW6esA7eX3ng1zW7XpU2dYanxYCS/TH62CHAMAYCmVAzjAiEEFPifitoWdcIKaA4FASCwLgyoaiLzDa6Jq76SJqxJpvGeJ6HqeQNg6DRoRYZplmYA4DACEAPgqDwPg4CAHAaBIDgO+ScNimCnNc0SLOq/YAtEiTbtsqMGySfrRt9Jyot80yJoomr9gAcRumvKAKgmCiTAO6CTIY5iFIWzwCPCqKiKqqydKoADDgAeR6Hmi7OAKB0/p0qLpL2fAEUMeB4HkC4NAyfB7nuX5el8CwMAufNLhmGIZQAuoAOgArRSFDUjoc/6LukiSiwa+p/K4px9n4AasHBWgO1s7h61y0Z/IWAIOA8DyKRlOyeQ5Yy7l+X5ggKAgDnK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AEAAABQdAAAGwEFAAEAAABYdAAAHAEDAAEAAAABAAAAKAEDAAEAAAACAAAAPQEDAAEAAAACAAAAUwEDAAMAAACWdAAAAAAAAGAAAAABAAAAYAAAAAEAAAAIAAgACAAoEgAAvhEAAGkSAABrFAAASRgAAGYQAAAIAAAAMBIAAO4jAABXNgAAwkoAAAtjAAABAAEAAQA=";

			//拍照控制
			var curentPtId="";
			var curentPtTypeName="";
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
			var curentPtRole="";
			var appVersionPlat="";
			var verifyStatusOwFlag=false;
			var verifyStatusLfFlag=false;
			//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
			var stallShow = true;
			var isShowInsurPtFace = false;//标识被保人人脸是否已经显示了
			var isShowInsurPtId = false;//标识被保人留影界面是否已经显示了
			//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
			$scope.isPhotoOpenFlag=true;
			$scope.isPhotoOCRFlag=true;
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
			
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 begin
			var idTypeAndCharge=photoMainData.idTypeAndCharge;
			var isNewHighRefundFeeFlag = "";
			if(idTypeAndCharge!=undefined && idTypeAndCharge!=null && idTypeAndCharge!=""){
				isNewHighRefundFeeFlag=idTypeAndCharge.isNewHighRefundFeeFlag;
				console.log("isNewHighRefundFeeFlag="+isNewHighRefundFeeFlag);
			}
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 end

			$scope.otherPtData=[];
			var otherPtData=[];
			var otherPtAddId=0;

			$scope.benefiIdPtData=[];
			var benefiIdPtData=[];
			var benefiIdPtAddId=0;
			
			$scope.data = {
				holderY: false,
				holderN: false,
				insuredY: false,
				insuredN: false,

				showHolderInfoFlag: false,
				showInsuredInfoFlag: false,
				showBenefiInfoFlag: false,
				showProfitInfoFlag: false, //受益人信息展示标记
				browserType : "", //客户端设备类型

				timeRest: null,
				textFlag: true,
				timePhoto: null,

				radioFlag: {
					holder: true,
					recognizee: true
				}
			};


			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
			var appVersionFlag = myFactory.getBrowserType();
			$scope.data.browserType = appVersionFlag;
			if(photoMainData.ow_idTypeName=="身份证"){
				$("#holderIdDate").attr("disabled","disabled");
			    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
                $("#holderIdDateStart").attr("disabled","disabled");
			    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				$("#holderIdDateType").attr("disabled","disabled");
				$("#holderCreType").css("color","#C9C9C9");
				if ( appVersionFlag != 'IOS'){
					 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
					$("#holderIdDateStart").css("color","#C9C9C9");
					 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					$("#holderIdDate").css("color","#C9C9C9");
				}
			}
			if(photoMainData.lf_idTypeName=="身份证"){
				$("#insuredIdDate").attr("disabled","disabled");
				 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				$("#insuredIdDateStart").attr("disabled","disabled");
				 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				$("#insuredIdDateType").attr("disabled","disabled");
				$("#insuredCreType").css("color","#C9C9C9");
				if( appVersionFlag != 'IOS'){
					 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
					$("#insuredIdDateStart").css("color","#C9C9C9");
					 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					$("#insuredIdDate").css("color","#C9C9C9");
					
				}
			}
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
			
			
			$scope.initLoad = function(){
				//initSign();//拍照初始化
				//startPhotoIterval();//拍照限时
				//idDateInit();//证件有效期初始化
				$scope.startPhotoIterval();
				idDateInit();//证件有效期初始化
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 begin
				$scope.item08IdPicIterval();
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 end
			}

			var imgContentId={//影像对应的contextid
				policyHolderPt:500,
				policyHolderIdPt:501,
				insuredPt:502,
				insuredIdPt:503,
				benefiPt:504,
				benefiIdPt:505,
				bankPt:506,
				otherPt:507
			}

			function idDateInit(){
				var holderIdDateType= $("#holderIdDateType");
				var holderIdDate= $("#holderIdDate");
				 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				var holderIdDateStart= $("#holderIdDateStart");
				var insuredIdDateStart= $("#insuredIdDateStart");
				var benefiIdIdDateStart= $("#benefiIdDateStart");
				 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var insuredIdDateType= $("#insuredIdDateType");
				var insuredIdDate =$("#insuredIdDate");

				var benefiIdDateType= $("#benefiIdDateType");
				var benefiIdIdDate= $("#benefiIdDate");

				if(holderIdDateType && holderIdDateType.val()=='1'){
					holderIdDate.val("");
					holderIdDate.attr("disabled",true);
				}

				if(insuredIdDateType && insuredIdDateType.val()=='1'){
					insuredIdDate.val("");
					insuredIdDate.attr("disabled",true);
				}

				if(benefiIdDateType && benefiIdDateType.val()=='1'){
					benefiIdIdDate.val("");
					benefiIdIdDate.attr("disabled",true);
				}
			}

			/******************页面部分显示逻辑处理begin**************/
			$scope.showPolicyHolderPtFlag=false;
			$scope.showPolicyHolderIdPtFlag=false;
			$scope.showInsuredPtFlag=false;
			$scope.showInsuredIdPtFlag=false;
			$scope.showBenefiPtFlag=false;
			$scope.showBenefiIdPtFlag=false;//权益人
			$scope.showProfitIdPtFlag=false;//受益人
			$scope.showBankPtFlag=false;
			$scope.showOtherPtFlag=false;
			/*$scope.showPolicyHolderPtFlag=true;
			$scope.showPolicyHolderIdPtFlag=true;
			$scope.showInsuredPtFlag=true;
			$scope.showInsuredIdPtFlag=true;
			$scope.showBenefiPtFlag=true;
			$scope.showBenefiIdPtFlag=true;//权益人
			$scope.showProfitIdPtFlag=true;//受益人
			$scope.showBankPtFlag=true;
			$scope.showOtherPtFlag=true;*/

			var checkFlag10=checkIsItemIdType("10");
			//投/被保人 投/被保人证件
			if(photoRule.policyHolder=='Y'){
				$scope.showPolicyHolderPtFlag=true;//显示
				
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
			/*	if(photoMainData.ow_idTypeName=="身份证" && "Y"==isNewHighRefundFeeFlag){
					facePageChange('div_policyHolderFs','div_policyHolderPt','checkImg_500');
				}*/
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
				if("Y"==isNewHighRefundFeeFlag || stallShow){
					facePageChange('div_policyHolderFs','div_policyHolderPt','checkImg_500');
				}
				//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
			}
			if(photoRule.policyHolderID=='Y'){
				
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
				//$("#photoZoneTbrId_a").attr('ng-click','scanIdcardPictures(\'501a\',\'policyHolderIdPt\',\'OW\')');
				//if(photoMainData.ow_idTypeName=="身份证"){
					//$("#photoZoneTbrId_a").attr('ng-click',"scanIdcardPictures('501a','policyHolderIdPt','OW')");
					//$("#photoZoneTbrId_b").attr('ng-click',"scanIdcardPictures('501b','policyHolderIdPt','OW')");
				//}
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				
				$scope.showPolicyHolderIdPtFlag=true;//显示
				$scope.data.showHolderInfoFlag=true;//显示

				if(policy.cownnum01==policy.lifcnum01){
					//$scope.policyHolderName="投/被保险人";
					$scope.policyHolderName="投保人";//20170816:要对显示多种签名者名称进行调整需求，rqyang
					$("#isSamePerson_a").val("Y");
				}else{
					$scope.policyHolderName="投保人";
					$("#isSamePerson_a").val("N");
				}

				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
				var ow_availDataType="";
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start 
                var ow_availDataStart="";
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var ow_availDataClose="";
				if(checkFlag10=="Y"){//含有变更项10 则设置证件有效期为变更后的类型
					ow_availDataType=photoMainData.ow_availDataType;//1 - 终身 2 - 年期 3 - 缺省
                    // S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start 
					ow_availDataStart=photoMainData.ow_availDataStart;   //有效期起始日
					//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end 
					ow_availDataClose=photoMainData.ow_availDataClose;
				}else{
					ow_availDataType=holderIdDate.flag01;//1 - 终身 2 - 年期 3 - 缺省
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start 
					ow_availDataStart=holderIdDate.dateup03;
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end 
					ow_availDataClose=holderIdDate.dateup01;
				}
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				
				$("#holderIdDateType").val(ow_availDataType);
				$scope.holderIdDateTypeSelect = ow_availDataType;
				var options_holder =$("#holderIdDateType option:selected");
				$scope.holderCreTypeName=options_holder.text();

				if(ow_availDataType=='2'){
					//var ow_availDataClose=holderIdDate.dateup01;
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start  
					if(ow_availDataStart!="" && ow_availDataStart!=null && ow_availDataStart!=undefined){
						$scope.photoMainData.ow_availDataStart=ow_availDataStart;
						myFactory.initDateUtil('holderIdDateStart',DateTools(ow_availDataStart));
					}else{
						myFactory.initDateUtil('holderIdDateStart','');
					}
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					if(ow_availDataClose!="" && ow_availDataClose!=null && ow_availDataClose!=undefined){
						$scope.photoMainData.ow_availDataClose=ow_availDataClose;
						myFactory.initDateUtil('holderIdDate',DateTools(ow_availDataClose));
					}else{
						myFactory.initDateUtil('holderIdDate','');
					}
				}else{
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start 
					myFactory.initDateUtil('holderIdDateStart',DateTools(ow_availDataStart));
					// S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					myFactory.initDateUtil('holderIdDate','');
				}
			}
			//S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题   add by csf20181119 start
			//被保人 投/被保人证件
			//var checkFlag10=checkIsItemIdType("10");
			if(photoRule.insured=='Y'){
				//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
				    isShowInsurPtId = true;
				  //S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
					$scope.showInsuredPtFlag=true;//显示
					
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
					if("Y"==isNewHighRefundFeeFlag || stallShow){
						console.log('被保人人脸识别');
						isShowInsurPtFace = true;
						facePageChange('div_insuredFs','div_insuredPt','checkImg_502');
					}
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
						//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
				}
				//else{S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题 注释掉
			var flag = sessionStorage.getItem("isChange_insured_item10");
			//增加判断被保人年龄大小是否超过18岁 add by csf 20181121 start 
			var birthday = policy.rnBirthday +"";
			var tempdate = birthday.substr(0,4) + "-" + birthday.substr(4,2) + "-" + birthday.substr(6,2);
			var age = getAge(tempdate);
					//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
					//当变更被保险人或同时变更投保人与被保险人，则才同时需要投保人与被保险人同时签名及身份证件留影。
			//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf start
					if(1==flag && age >= 18 &&!isSamePerson ){
						//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf end
			//增加判断被保人年龄大小是否超过18岁 add by csf 20181121 end
						//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
						if (!isShowInsurPtId){
							$scope.showInsuredPtFlag=true;//显示
						}
						//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
						//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
						if("Y"==isNewHighRefundFeeFlag || stallShow){
							console.log('被保人人脸识别');
							//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
							if (!isShowInsurPtFace){
								//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
								facePageChange('div_insuredFs','div_insuredPt','checkImg_502');
							}
						}
						//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
					}
					//S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题   add by csf20181119 end
			//checkFlag10
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
			/*var itemIdCard10_ow=photoMainData.itemIdCard10_ow;
			var itemIdCard10_lf=photoMainData.itemIdCard10_lf;
			setItem10Base64Img(itemIdCard10_ow,"ow");
			setItem10Base64Img(itemIdCard10_lf,"lf");*/
			if(checkFlag10=="Y"){//含有变更项10 则做自动判断证件OCR
				//alert("checkFlag10"+checkFlag10);
				autoSetItem10IdPic();
			}
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
			//变更非10时被保人有效期没显示 add by csf start
//			if(photoRule.insuredID=='Y'){
//				$scope.showInsuredIdPtFlag=true;//显示
//				$scope.data.showInsuredInfoFlag=true;
//				
//				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
//				var lf_availDataType=photoMainData.lf_availDataType;//1 - 终身 2 - 年期 3 - 缺省
//				var lf_availDataClose=photoMainData.lf_availDataClose;
//				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
//				
//				//$("#insuredIdDateType").val(insuredIdDate.flag01);
//				$("#insuredIdDateType").val(lf_availDataType);
//				//$scope.insuredIdDateTypeSelect = insuredIdDate.flag01;
//				$scope.insuredIdDateTypeSelect = lf_availDataType;
//				var options_insured =$("#insuredIdDateType option:selected");
//				$scope.insuredCreTypeName=options_insured.text();
//				myFactory.initDateUtil('insuredIdDate','');
//				
//				if(lf_availDataType=='2'){
//					if(lf_availDataClose!="" && lf_availDataClose!=null && lf_availDataClose!=undefined){
//						$scope.photoMainData.lf_availDataClose=lf_availDataClose;
//						myFactory.initDateUtil('insuredIdDate',DateTools(lf_availDataClose));
//					}else{
//						myFactory.initDateUtil('insuredIdDate','');
//					}
//				}
//			}
			if(photoRule.insuredID=='Y'){
				//S2018091005428-移动保全人脸核身优化需求 start
//				if(checkFlag10=="N"){
				//S2018091005428-移动保全人脸核身优化需求 end
					$scope.showInsuredIdPtFlag=true;//显示
					$scope.data.showInsuredInfoFlag=true;
					$("#insuredIdDateType").val(insuredIdDate.flag01);
					//$scope.insuredIdDateTypeSelect = insuredIdDate.flag01;
					$scope.insuredIdDateTypeSelect = insuredIdDate.flag01;
					var options_insured =$("#insuredIdDateType option:selected");
					$scope.insuredCreTypeName=options_insured.text();
				 	//myFactory.initDateUtil('insuredIdDate','');
					if(insuredIdDate.flag01=='2'){
					    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
						var lf_availDataStart=insuredIdDate.dateup03;
						if(lf_availDataStart!="" && lf_availDataStart!=null && lf_availDataStart!=undefined){
							
							if(checkFlag10=="N"){
								$scope.photoMainData.lf_availDataStart=lf_availDataStart;
							}
							
							myFactory.initDateUtil('insuredIdDateStart',DateTools(lf_availDataStart));
						}else{
							myFactory.initDateUtil('insuredIdDateStart','');
						}
						//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end 
						var lf_availDataClose=insuredIdDate.dateup01;
						if(lf_availDataClose!="" && lf_availDataClose!=null && lf_availDataClose!=undefined){
							//S2018091005428-移动保全人脸核身优化需求 start
							if(checkFlag10=="N"){
								//S2018091005428-移动保全人脸核身优化需求 end
								$scope.photoMainData.lf_availDataClose=lf_availDataClose;
							}
							
							myFactory.initDateUtil('insuredIdDate',DateTools(lf_availDataClose));
						}else{
							myFactory.initDateUtil('insuredIdDate','');
						}
					}else{
						myFactory.initDateUtil('insuredIdDate','');
					}
//				}
			}
			//变更非10时被保人有效期没显示 add by csf end
				//else{
//					var flag = sessionStorage.getItem("isChange_insured_item10");
//					//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
//					/**S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题 add by csf 20181114  start
//					对于多项变更项的处理,如果被保人信息没有被修改则判断是否为多项变更，是的话就显示被保人信息
//					 */
//					var isManyItes = checkMany();
////					if(1==flag){
//					//检测是否是多项变更项 add by csf 20181114 start
//					//对于多项变更项的处理,如果被保人信息没有被修改则判断是否为多项变更，是的话就显示被保人信息
//						if(1==flag || isManyItes){
//						$scope.showInsuredIdPtFlag=true;//显示
//						$scope.data.showInsuredInfoFlag=true;
//						
//						//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
//						var lf_availDataType=photoMainData.lf_availDataType;//1 - 终身 2 - 年期 3 - 缺省
//						var lf_availDataClose=photoMainData.lf_availDataClose;
//						//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
//						
//						//$("#insuredIdDateType").val(insuredIdDate.flag01);
//						$("#insuredIdDateType").val(lf_availDataType);
//						//$scope.insuredIdDateTypeSelect = insuredIdDate.flag01;
//						$scope.insuredIdDateTypeSelect = lf_availDataType;
//						var options_insured =$("#insuredIdDateType option:selected");
//						$scope.insuredCreTypeName=options_insured.text();
//						myFactory.initDateUtil('insuredIdDate','');
//						
//						if(lf_availDataType=='2'){
//							if(lf_availDataClose!="" && lf_availDataClose!=null && lf_availDataClose!=undefined){
//								$scope.photoMainData.lf_availDataClose=lf_availDataClose;
//								myFactory.initDateUtil('insuredIdDate',DateTools(lf_availDataClose));
//							}else{
//								myFactory.initDateUtil('insuredIdDate','');
//							}
//						}
//					}
//				}
//			}
			//判断被保人信息是否被更改
			var flag = sessionStorage.getItem("isChange_insured_item10");
			//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf start
			if(1==flag && !isSamePerson){
				//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf end
				$scope.showInsuredIdPtFlag=true;//显示
				$scope.data.showInsuredInfoFlag=true;
				
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
				var lf_availDataType=photoMainData.lf_availDataType;//1 - 终身 2 - 年期 3 - 缺省
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				var lf_availDataStart=photoMainData.lf_availDataStart;
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var lf_availDataClose=photoMainData.lf_availDataClose;
				//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				
				//$("#insuredIdDateType").val(insuredIdDate.flag01);
				$("#insuredIdDateType").val(lf_availDataType);
				//$scope.insuredIdDateTypeSelect = insuredIdDate.flag01;
				$scope.insuredIdDateTypeSelect = lf_availDataType;
				var options_insured =$("#insuredIdDateType option:selected");
				$scope.insuredCreTypeName=options_insured.text();
				myFactory.initDateUtil('insuredIdDate','');
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
                myFactory.initDateUtil("insuredIdDateStart","");
                if(lf_availDataType=='2'){
					if(lf_availDataStart!="" && lf_availDataStart!=null && lf_availDataStart!=undefined){
						$scope.photoMainData.lf_availDataStart=lf_availDataStart;
						myFactory.initDateUtil('insuredIdDateStart',DateTools(lf_availDataStart));
					}else{
						myFactory.initDateUtil('insuredIdDateStart','');
					}
				}
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				
				if(lf_availDataType=='2'){
					if(lf_availDataClose!="" && lf_availDataClose!=null && lf_availDataClose!=undefined){
						$scope.photoMainData.lf_availDataClose=lf_availDataClose;
						myFactory.initDateUtil('insuredIdDate',DateTools(lf_availDataClose));
					}else{
						myFactory.initDateUtil('insuredIdDate','');
					}
				}
			}
			//S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题 add by csf 20181114  end  			
			
			//权益人
			if(photoRule.benefi=='Y'){
				var checkFlag08=checkIsItemIdType("08");
				if(checkFlag08=="N"){
					$scope.showBenefiPtFlag=true;//显示权益人留影
				}
			}

			//权益人、受益人 证件留影
			//if(1==1){
			if(photoRule.benefiID=='Y'){
				var typeResult=checkIsBenefiItemIdType();
				if(typeResult=="N"){
					$scope.showBenefiIdPtFlag=true;//显示权益人证件
				}else if(typeResult=="Y_08_S"){
					$scope.showProfitIdPtFlag=true;//显示受益人证件
				}else if(typeResult=="Y_08_B"){
					$scope.showBenefiIdPtFlag=true;//显示权益人证件
				}else if(typeResult=="Y_08_D"){
					$scope.showBenefiIdPtFlag=true;//显示权益人证件
					$scope.showProfitIdPtFlag=true;//显示受益人证件
				}

				//受益人证件留影：动态生成，名字获取仅仅来自受益人变更功能模块录入数据
				var checkFlag08=checkIsItemIdType("08");//存在身故受益人则获取名字信息
				if(checkFlag08=="Y") {//身故受益人
					//数据初步设计：可以将要变更为显示对应的受益人名字在前面存入sessionStorage缓存中进行处理
					var benefitList = photoMainData.benefitList;
					if(benefitList.length>0){
						$scope.data.showProfitInfoFlag = true;
						for(var i = 0; i < benefitList.length; i++){
							var name = benefitList[i].name;//姓名
							var idNo = benefitList[i].idNo;//证件号码
							var idType = benefitList[i].idType;
							var IDTypeCN = benefitList[i].idtypeCN;//证件类型
							var availDataType = benefitList[i].availDataType;//有效期类型
							var availDataTypeCN = benefitList[i].availDataTypeCN;
							var availDataStart = benefitList[i].availDataStart;//有效期起始日
							var availDataClose = availDataType == '1' ? '' : benefitList[i].availDataClose;//有效期截至日
							var ida='505_a' + benefiIdPtAddId;
							var idb='505_b' + benefiIdPtAddId;
							var picVal = {
								'keyId': benefiIdPtAddId,
								'name': name,
								'ida': ida,
								'idb': idb,
								'idType': idType,
								'IDTypeCN': IDTypeCN,
								'idNo': idNo,
								'availDataType': availDataType,
								'availDataTypeCN': availDataTypeCN,
								'availDataStart': availDataStart,
								'availDataClose': availDataClose,
								'checkedY' : false,
								'checkedN' : false
							};
							benefiIdPtData.push(picVal);
							benefiIdPtAddId++;
						}
						$scope.benefiIdPtData=benefiIdPtData;
						var benefiIdPtDataJson = JSON.stringify(benefiIdPtData);
						console.log("当前benefiIdPtData:"+benefiIdPtDataJson);
						$scope.benefiIdPtData=benefiIdPtData;
					}
				}
			}
			if(photoRule.benefiID=='Y'&& photoMainData.showBenefiIdDate!='N'){
				$scope.data.showBenefiInfoFlag=true;
				var flag01="";
				if(benefiIdDate!=null && benefiIdDate!=undefined && benefiIdDate!=""){
					flag01=benefiIdDate.flag01;
				}else{//赋给默认选择第一个
					flag01="2";
				}
				$("#benefiIdDateType").val(flag01);
				$scope.benefiIdDateTypeSelect =flag01;
				var options_benefi =$("#benefiIdDateType option:selected");
				$scope.benefiCreTypeName=options_benefi.text();
				myFactory.initDateUtil('benefiIdDate','');
			}

			//银行卡
			if(photoRule.bank=='Y'){
				$scope.showBankPtFlag=true;//显示
			}
			//其他随附资料
			if(photoRule.other=='Y' ||checkFlag10=="Y" ){
				$scope.showOtherPtFlag=true;//显示
			}
			
			//拍照函数
			$scope.takePictures = function(context_id,typeName){
				if($scope.isPhotoOpenFlag){
					$scope.isPhotoOpenFlag=false;
					setTimeout(function() {
						$scope.isPhotoOpenFlag=true;
					}, 350);
				}else{
					return false;
				}
				/*var appVersionFlag = myFactory.getBrowserType();
				console.log("appVersionFlag:"+appVersionFlag);
				var data = {};
				if(appVersionFlag=="Android" || appVersionFlag=="Browser"){//安卓版本未有解决新接口，需分离平台调用
					data = {
							//title : '投保人（留影）',
							width : '960',
							height : '720',
							//mono : 'true',//bool 此选项无效
							mono : 'false',//bool 此选项无效[false支持彩色图片]
							quality : '50',//int 0~100 推荐85
							//quality : '5',
							openFromGallery : 'false',//是否从相册选择照片
							//openFromGallery : 'true',//是否从相册选择照片
							//businessType : '2'
							businessType : '0'//去除“请拍摄人脸”
					};
				}else if(appVersionFlag=="IOS"){
					var openFromGallery=false; //true:从相册中选择，false:拍照
					data = {
							openFromGallery : openFromGallery,//是否从相册选择照片：true:从相册中选择，false:拍照
							imgType : 'OtherPhoto'//固定值，千万不要改动
					};
				}*/
				var openFromGallery=false; //true:从相册中选择，false:拍照
				var data = {
						openFromGallery : openFromGallery,//是否从相册选择照片：true:从相册中选择，false:拍照
						imgType : 'OtherPhoto'//固定值，千万不要改动
				};

				if(curentPtId!=""){
					curentPtId="";
					curentPtTypeName="";
				}
				curentPtId=context_id;
				curentPtTypeName=typeName;

				if(context_id=='507'){
					if(maxTime==0){//如果超出时间限制测不能再拍照
						myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
						return false;
					}
					//其他资料
					if(otherPtData.length==10){//其他资料（最多10张）
						/*S2018122906735移动保全新增变更项目及功能的优化需求 update by mqz 20200901 start*/
						if(strItemIds.indexOf('15')>-1 || strItemIds.indexOf('29')>-1 || strItemIds.indexOf('30')>-1 ){
							myFactory.alert('','体检报告最多10张！','info');
							return false;
						}else{
							myFactory.alert('','其他资料最多10张！','info');
							return false;
						}
						/*S2018122906735移动保全新增变更项目及功能的优化需求 update by mqz 20200901 end*/
					}
					
					var appVersionFlag = myFactory.getBrowserType();
					console.log("appVersionFlag:"+appVersionFlag);
					if(appVersionFlag=="Android"){
					}else if(appVersionFlag=="IOS"){
					}else if(appVersionFlag=="Browser"){
						console.log("当前otherPtData.length:"+otherPtData.length);
						if(otherPtData.length==0){//重置动态资源变量
							otherPtAddId=0;
						}
						var otherPtDataJson = JSON.stringify(otherPtData);
						console.log("当前otherPtData:"+otherPtDataJson);

						//数组参数
						var keyId=otherPtAddId;
						var url='data:image/gif;base64,'+testVal;
						var ido=otherPtAddId;
						var idPt=testVal;
						var picVal={'keyId':keyId,'url': url,'ido':ido,'idPt':idPt};

						otherPtData.push(picVal);
						otherPtAddId++;
						$scope.otherPtData=otherPtData;

						/*console.log("---------------------add begin-----------------------");
						console.log("点击新增后otherPtData.length:"+otherPtData.length);
						var otherPtDataJson = JSON.stringify(otherPtData);
						console.log("点击新增后otherPtData:"+otherPtDataJson);

						var otherPtDataTemp=$scope.otherPtData;
						console.log("点击新增后otherPtDataTemp.length:"+otherPtDataTemp.length);
						var otherPtDataTempJson = JSON.stringify(otherPtDataTemp);
						console.log("点击新增后otherPtDataTemp:"+otherPtDataTempJson);
						console.log("---------------------add end-----------------------");*/

						return false;
					}else{
					}
					/****************测试数据*****************/
				}else{
					var photoValTemp=$("#"+typeName+"_"+context_id).val();
					if(photoValTemp!=""){
						console.log("there ware a pic");
						return false;
					}
					
					if(maxTime==0){//如果超出时间限制测不能再拍照
						myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
						return false;
					}
					
					var appVersionFlag = myFactory.getBrowserType();
					console.log("appVersionFlag:"+appVersionFlag);
					if(appVersionFlag=="Android"){
					}else if(appVersionFlag=="IOS"){
					}else if(appVersionFlag=="Browser"){
						$("#img_"+typeName+"_"+context_id).attr('src','data:image/gif;base64,'+testVal);
						$("#"+typeName+"_"+context_id).val(testVal);
						$("#img_"+typeName+"_"+context_id).css('display','inline');
						$("#photo_cover_"+context_id).css('display','none');
						$("#text_cover_"+context_id).css('display','none');
						$("#delImg_"+context_id).css('display','inline');
						return false;
					}else{
					}
					/****************测试数据*****************/
				}
				
				//console.log("appVersionFlag:"+appVersionFlag);
				/*if(appVersionFlag=="Android"){//安卓版本未有解决新接口，需分离平台调用
					cordova.sino.takePhoto(callBackFun_Photo, data);//北京CA拍照接口
				}else if(appVersionFlag=="IOS"){
					cordova.sino.takePhotoOther(callBackFun_Photo, data);//信易通拍照接口
				}*/
				cordova.sino.takePhotoOther(callBackFun_Photo, data);//信易通拍照接口
			}

			var callBackFun_Photo = function(result){
				var data = result.data;
				var val = data.Base64Img;//拍照数据
				
				/***************writePhotoLog begin******************/
				var callXytParam="curentPtId="+curentPtId+",调用信易通方法：cordova.sino.takePhotoOther(callBackFun_Photo, data),参数值内容data[openFromGallery=false,imgType='OtherPhoto']";
				/*var picLogVal=val;
				if(picLogVal!=undefined && picLogVal!=null || picLogVal!=""){
					if(picLogVal.length>500){
						picLogVal=picLogVal.substring(0,500);
					}
				}*/
				var logParam={
						"opType":"photo",
						"curentPtId":callXytParam,
						"chdrnum":chdrnum01,
						"photoDataLog":data,
						"photoDataLogVal":val
				};
				$scope.writePhotoLog(logParam);
				/***************writePhotoLog end******************/
				
				if(val==undefined || val==null || val==""){
					return false;
				}
				/*var appVersionFlag = myFactory.getBrowserType();
				console.log("appVersionFlag:"+appVersionFlag);
				if(appVersionFlag=="Android"){//安卓版本未有解决新接口，需分离平台调用
					val = data.signImg;//拍照数据
				}else if(appVersionFlag=="IOS"){
					val = data.Base64Img;//拍照数据
				}*/

				if(curentPtId!=''){
					if(curentPtId=='507'){
						console.log("当前otherPtData.length:"+otherPtData.length);
						if(otherPtData.length==0){//重置动态资源变量
							otherPtAddId=0;
						}
						//var otherPtDataJson = JSON.stringify(otherPtData);
						//console.log("当前otherPtData:"+otherPtDataJson);

						//数组参数
						var keyId=otherPtAddId;
						var url='data:image/gif;base64,'+val;
						var ido=otherPtAddId;
						var idPt=val;

						var picVal={'keyId':keyId,'url': url,'ido':ido,'idPt':idPt};
						otherPtData.push(picVal);
						otherPtAddId++;
						$scope.otherPtData=otherPtData;

						/*console.log("---------------------add begin-----------------------");
						console.log("点击新增后otherPtData.length:"+otherPtData.length);
						var otherPtDataJson = JSON.stringify(otherPtData);
						console.log("点击新增后otherPtData:"+otherPtDataJson);

						var otherPtDataTemp=$scope.otherPtData;
						console.log("点击新增后otherPtDataTemp.length:"+otherPtDataTemp.length);
						var otherPtDataTempJson = JSON.stringify(otherPtDataTemp);
						console.log("点击新增后otherPtDataTemp:"+otherPtDataTempJson);
						console.log("---------------------add end-----------------------");*/
					}else{
						$("#img_"+curentPtTypeName+"_"+curentPtId).css('display','inline');
						$("#photo_cover_"+curentPtId).css('display','none');
						$("#text_cover_"+curentPtId).css('display','none');
						$("#img_"+curentPtTypeName+"_"+curentPtId).attr('src','data:image/gif;base64,'+val);
						$("#"+curentPtTypeName+"_"+curentPtId).val(val);
						$("#delImg_"+curentPtId).css('display','inline');
					}

				}
			}

			//点击删除签名图片
			$scope.deletePhoto = function(e,context_id,typeName){
				e.stopPropagation();

				$("#img_"+typeName+"_"+context_id).css('display','none');
				$("#img_"+typeName+"_"+context_id).attr('src','');
				$("#"+typeName+"_"+context_id).val("");

				$("#photo_cover_"+context_id).css('display','block');
				$("#text_cover_"+context_id).css('display','block');
				$("#delImg_"+context_id).css('display','none');
			}
			
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 begin
			$scope.deleteFacePhoto = function(e,context_id,typeName){
				e.stopPropagation();
				$("#face_img_"+typeName+"_"+context_id).css('display','none');
				$("#face_img_"+typeName+"_"+context_id).attr('src','');
				$("#"+typeName+"_"+context_id).val("");
				$("#face_photo_cover_"+context_id).css('display','block');
				$("#face_text_cover_"+context_id).css('display','block');
				$("#face_delImg_"+context_id).css('display','none');
				
				//$("#checkImg_"+context_id).attr({"src":''});
				$("#checkImg_"+context_id).css('display','none');
				if(context_id=="500"){
					verifyStatusOwFlag=false;
				}else if(context_id=="502"){
					verifyStatusLfFlag=false;
				}
			}
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180729 end

			//点击删除签名图片deletePhoto_otherPt
			$scope.deletePhoto_otherPt = function($event,context_id,keyId){
				//e.stopPropagation();
				if(context_id=='507'){
					$($event).parent('.create_img_wrap').remove();

					console.log("删除keyId:"+keyId);
					for(var i=0;i<otherPtData.length;i++) {
						var keyIdTemp = otherPtData[i].keyId;
						if(keyIdTemp==keyId) {
							otherPtData.splice(i,1);
						}
					}

					/*console.log("--------------------del begin------------------------");
					//console.log("点击删除后tmpData.length:"+otherPtData.length);
					var otherPtDataJson = JSON.stringify(otherPtData);
					//console.log("剩余数据otherPtData:"+otherPtDataJson);

					var otherPtDataTemp=$scope.otherPtData;
					//console.log("点击删除后otherPtDataTemp.length:"+otherPtDataTemp.length);
					var otherPtDataTempJson = JSON.stringify(otherPtDataTemp);
					//console.log("点击删除后otherPtDataTempJson:"+otherPtDataTempJson);
					console.log("--------------------del end------------------------");*/
				}

			}

			/******************页面部分显示逻辑处理end**************/
			$scope.onIdDateTypeChange = function(item1,item2){
				var options = "";
				if(item1=='holderIdDateType'){
					options =$("#holderIdDateType option:selected");
					$scope.holderCreTypeName=options.text();
				}else if(item1=='insuredIdDateType'){
					options =$("#insuredIdDateType option:selected");
					$scope.insuredCreTypeName=options.text();
				}else if(item1=='benefiIdDateType'){
					options =$("#benefiIdDateType option:selected");
					$scope.benefiCreTypeName=options.text();
				}else if (item1.indexOf('benfIdDateType_' != -1)){
					options = $("#"+ item1 +" option:selected");
					$scope.benefiIdPtData[item2].availDataTypeCN=options.text();
				}
				console.log("val:"+options.val());
				console.log("text:"+options.text());

				//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
				if(item1.indexOf('benfIdDateType_' != -1)){
					var idaArr = item1.split("_");
					item2 = "benfIdDate_"+idaArr[1]+"_"+idaArr[2];
				}
				//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
				var type =$("#"+item1).val();
				if(type=='1'){
					$("#"+item2).val("");
					$("#"+item2).attr("disabled",true);
				}else{
					$("#"+item2).removeAttr("disabled");
				}

			}
			//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
			
			//单选按钮样式控制
			$scope.choose_radio_label = function(state,flagName){
				if (state) {
					$scope.data[flagName+"Y"] = true;
					$scope.data[flagName+"N"] = false;
					console.log("selected:"+state);
				} else{
					$scope.data[flagName+"Y"] = false;
					$scope.data[flagName+"N"] = true;
					console.log("selected:"+state);
				};
			}

			//受益人单选按钮控制
			$scope.chooseBenfVerify = function(state, index) {
				$scope.benefiIdPtData[index].checkedY = state;
				$scope.benefiIdPtData[index].checkedN = !state;
			}

			//拍照倒计时3分钟
			$scope.startPhotoIterval = function(){
				maxTime=500;//100;//3*60
				timeOutPhoto="N";
				$scope.data.textFlag = false;
				$scope.data.timeRest = maxTime;
				$scope.data.timePhoto = $interval(function(){
					//console.log("timePhoto1:"+maxTime);
					//$("#ipttime").val(maxTime);
					maxTime--;
					//console.log("timePhoto2:"+maxTime);
					
					if (maxTime < 1) {
						//$scope.data.timeCon = "获取手机验证码";
						$scope.data.textFlag = true;
						$interval.cancel($scope.data.timePhoto);
					} else {
						$scope.data.timeRest = maxTime;
					}

					if(maxTime==0){
						timeOutPhoto="Y";
						$scope.data.timeRest = maxTime;
						//myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
						//$("#ipttime").val(maxTime);
						//$scope.changeImg('valnumPic');//优化一下，过期不刷新，免得客户觉得又要多一次输入验证码
						//$("#valnum").val("");
						//stopIterval(timer);
						return false;
					}
				}, 1000);
			}

			
			/*根据出生日期算出年龄*/  
			function getAge(strBirthday){         
				var returnAge;  
				var strBirthdayArr=strBirthday.split("-");  
				var birthYear = strBirthdayArr[0];  
				var birthMonth = strBirthdayArr[1];  
				var birthDay = strBirthdayArr[2];  
				
				d = new Date();  
				var nowYear = d.getFullYear();  
				var nowMonth = d.getMonth() + 1;  
				var nowDay = d.getDate();  
				
				if(nowYear == birthYear){  
					returnAge = 0;//同年 则为0岁  
				} else {  
					var ageDiff = nowYear - birthYear ; //年之差  
					if(ageDiff > 0){  
						if(nowMonth == birthMonth) {  
							var dayDiff = nowDay - birthDay;//日之差  
							if(dayDiff < 0) {  
								returnAge = ageDiff - 1;  
							} else {  
								returnAge = ageDiff ;  
							}  
						} else {  
							var monthDiff = nowMonth - birthMonth;//月之差  
							if(monthDiff < 0) {  
								returnAge = ageDiff - 1;  
							} else {  
								returnAge = ageDiff ;  
							}  
						}  
					} else {  
						returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天  
					}  
				}  
				return returnAge;//返回周岁年龄  
			}

			/*判断证件有效期是否正确*/
			function checkIdCardDate(birthDay, availDateStart, availDateClose) {
				var _availDateStart = availDateStart.replaceAll('-','');
				var _availDateClose = availDateClose.replaceAll('-','');
				var isPerpetual = availDateClose == '长期' || availDateClose == '终身';
				var beginMMDD = _availDateStart.substr(4, 4);
				var endMMDD = isPerpetual ? "" : _availDateClose.substr(4, 4);
				if (!isPerpetual && beginMMDD != '0229' && endMMDD != '0229' && beginMMDD != endMMDD) { //任一日期为2月29日不检测
					return false;
				}
				var realAge = getPeriod(birthDay.replaceAll('-', ''), _availDateStart);//办证年龄
				var validity = isPerpetual ? 0 : getPeriod(_availDateStart, _availDateClose);//证件年限
				if ((realAge < 16 && validity != 5)
					|| (realAge >= 16 && realAge <= 25 && validity != 10)
					|| (realAge >= 26 && realAge <= 45 && validity != 20)
					|| (realAge >= 46 && validity != 0)
				) {
					return false;
				}
				return true;
			}

			//计算年限
			function getPeriod(startDate, endDate) {
				var li_yy = 0;
				//转换日期格式暂时省略
				var startDate_yy = startDate.substr(0, 4);
				var startDate_mm = startDate.substr(4, 2);
				var startDate_dd = startDate.substr(6, 2);
				var endDate_yy = endDate.substr(0, 4);
				var endDate_mm = endDate.substr(4, 2);
				var endDate_dd = endDate.substr(6, 2);
				if (parseInt(startDate) > parseInt(endDate)) {
					return li_yy;
				}
				li_yy = endDate_yy - startDate_yy;
				if (endDate_mm < startDate_mm) {
					li_yy--;
				} else {
					if (endDate_mm == startDate_mm && endDate_dd < startDate_dd) {
						li_yy--;
					}
				}
				return li_yy;
			}
			
			//提交表单
			$scope.onsub = function () {
				myFactory.loadingShow();//显示加载圈
				if(maxTime==0){//如果超出时间限制则不能再拍照
					if(timeOutPhoto=="Y"){
						myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
						myFactory.loadingHide();
					}
					return false;
				}

				var photoCheck=submitCheck();
				console.log("photoCheck:"+photoCheck);
				if(!photoCheck){
					console.log("拍照校验不通过");
					myFactory.loadingHide();
					return false;
				}
				console.log("拍照校验通过");
				$interval.cancel($scope.data.timePhoto);//立即终止倒计时,避免出现滚动条转动的时候已经到时间临界点

				
			    var idtype_t = $("#idtype_t").val(); //投保人证件类型（注意是中文名字）
			    var idtype_b = $("#idtype_b").val(); //被保人证件类型（注意是中文名字）
			    var secuityno_t = $("#secuityno_t").val();//投保人证件号码
			    var rnIdNumber_b = $("#rnIdNumber_b").val();//被把人证件号码
			    //S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 start
				if(idtype_t=='外国人永久居留身份证' && $("#holderIdDateType").val()==1){
					/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
					myFactory.alert("","投保人的证件类型为'外国人永久居留身份证',有效期类型不可选择长期","info");
					/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
					myFactory.loadingHide();
					return false;
				}
				if(idtype_b=='外国人永久居留身份证' && $("#insuredIdDateType").val()==1){
					/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
					myFactory.alert("","被保险人的证件类型为'外国人永久居留身份证',有效期类型不可选择长期","info");
					/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
					myFactory.loadingHide();
					return false;
				}
				//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 end
				
				//证件类型为身份证时，45岁（含）以下证件有效期不可为终身   BY ZZQ 2017-10-21
				if(idtype_t=='身份证' && $("#holderIdDateType").val()==1){
					var iDate = secuityno_t.length == 18 ? secuityno_t.substr(6, 8) : ""//出生日期
					if (iDate != "") {
				  		var tempdate = iDate.substr(0,4) + "-" + iDate.substr(4,2) + "-" + iDate.substr(6,2);
						var age = getAge(tempdate);
						if (age <= 45) {
							/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
							myFactory.alert("","45岁（含）以下有效期类型不可为长期，请重新确认!","info");
							/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
							myFactory.loadingHide();
							return false;
						}
				  	}
				}
				if(idtype_b=='身份证' && $("#insuredIdDateType").val()==1){
					var iDate = rnIdNumber_b.length == 18 ? rnIdNumber_b.substr(6, 8) : ""//出生日期
					if (iDate != "") {
				  		var tempdate = iDate.substr(0,4) + "-" + iDate.substr(4,2) + "-" + iDate.substr(6,2);
						var age = getAge(tempdate);
						if (age <= 45) {
							myFactory.alert("","45岁（含）以下有效期类型不可为终身，请重新确认!","info");
							myFactory.loadingHide();
							return false;
						}
				  	}
				}
				
				var isVerify_a_Y=$scope.data.holderY;
				var isVerify_a_N=$scope.data.holderN;

				//投/被保人
				if(photoRule.policyHolderID=='Y'){
					if(false==isVerify_a_Y && false==isVerify_a_N){
						myFactory.alert('','请核对投保人证件号码是否一致！','info');
						myFactory.loadingHide();
						return false;
					}else{
						var isSamePerson_a = document.getElementById("isSamePerson_a").value;
						//var a = isVerify_a.value;
						var str = "";
						if("Y"==isSamePerson_a){
							//str = "投/被保险人";
							str = "投保人";
						}else{
							str = "投保人";
						}
						if(true==isVerify_a_N){
							myFactory.alert('',str+'证件发生变化（或证件号码变更后与证件原件号码不一致），请客户同时办理客户身份信息变更！','info');
							myFactory.loadingHide();
							return false;
						}
					}
				}
				
				var isVerify_b_Y=$scope.data.insuredY;
				var isVerify_b_N=$scope.data.insuredN;
				//被保人
				//if(1==1){
				if(photoRule.insuredID=='Y'){
					if(checkFlag10=="N"){
						if(false==isVerify_b_Y && false==isVerify_b_N){
							myFactory.alert('','请核对被保险人证件号码是否一致！','info');
							myFactory.loadingHide();
							return false;
						}else{
							if(true==isVerify_b_N){
								myFactory.alert('','被保险人证件发生变化（或证件号码变更后与证件原件号码不一致），请客户同时办理客户身份信息变更！','info');
								myFactory.loadingHide();
								return false;
							}
						}
					}else{
						var flag = sessionStorage.getItem("isChange_insured_item10");
						//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
						//当变更被保险人或同时变更投保人与被保险人，则才同时需要投保人与被保险人同时签名及身份证件留影。
						//如果被保人信息没有被更改
						//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf start
						if(1==flag && !isSamePerson){
						//判断投保人被保人是否同一个人，是的话，即使更新了10变更项，也仍然不需要被保人签名 add by csf end
							if(false==isVerify_b_Y && false==isVerify_b_N){
								myFactory.alert('','请核对被保险人证件号码是否一致！','info');
								myFactory.loadingHide();
								return false;
							}else{
								if(true==isVerify_b_N){
									myFactory.alert('','被保险人证件发生变化（或证件号码变更后与证件原件号码不一致），请客户同时办理客户身份信息变更！','info');
									myFactory.loadingHide();
									return false;
								}
							}
						}
					}
				}

				var frm_photo="img/gotoFinish.action";

				//证件有效期类型和证件有效期
				var holderIdDateType = $("#holderIdDateType").val();
				//var holderIdDateType = $("#holderIdDateType option:selected").val();
				var holderIdDate = $("#holderIdDate").val();
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
                var holderIdDateStart = $("#holderIdDateStart").val();
                var insuredIdDateStart = $("#insuredIdDateStart").val();
                var benefiIdDateStart = $("#benefiIdDateStart").val();
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var insuredIdDateType = $("#insuredIdDateType").val();
				//var insuredIdDateType = $("#insuredIdDateType option:selected").val();
				var insuredIdDate = $("#insuredIdDate").val();
				var benefiIdDateType = $("#benefiIdDateType").val();
				//var benefiIdDateType = $("#benefiIdDateType option:selected").val();
				var benefiIdDate = $("#benefiIdDate").val();

				if(holderIdDateType==undefined || holderIdDateType.indexOf("undefined")>=0){
					holderIdDateType="";
				}
				if(holderIdDate==undefined){
					holderIdDate="";
				}
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				if(holderIdDateStart==undefined){
					holderIdDateStart="";
				}
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				if(insuredIdDateType==undefined || insuredIdDateType.indexOf("undefined")>=0){
					insuredIdDateType="";
				}
				if(insuredIdDate==undefined){
					insuredIdDate="";
				}
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				if(insuredIdDateStart==undefined){
					insuredIdDateStart="";
				}
		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				if(benefiIdDateType==undefined || benefiIdDateType.indexOf("undefined")>=0){//? undefined:undefined ? str.indexOf(substr) >= 0
					benefiIdDateType="";
				}
				if(benefiIdDate==undefined){
					benefiIdDate="";
				}
				//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				if(benefiIdDateStart==undefined){
					benefiIdDateStart="";
				}
				
				//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 start
				if(idtype_t=='外国人永久居留身份证'){
					if(holderIdDateStart!="" && holderIdDate!=""){
						var birthday = policy.cltdob +"";
						if(photoMainData.ow_birthday!=""){
							birthday = photoMainData.ow_birthday;
						}
						console.log("holderIdDateStart="+holderIdDateStart);
						console.log("holderIdDate="+holderIdDate);
						console.log("birthday="+birthday);
						if(!changeAvailDataStart(holderIdDateStart,holderIdDate,birthday)){
							myFactory.alert("","您填写的投保人证件有效期不正确，请按证件上的实际有效日期填写！","info");
							myFactory.loadingHide();
							return false;
						}
					}
				}
								
				if(idtype_b=='外国人永久居留身份证'){
					if(insuredIdDateStart!="" && insuredIdDate!=""){
						var birthday = policy.rnBirthday +"";
						if(photoMainData.lf_birthday!=""){
							birthday = photoMainData.lf_birthday;
						}
						console.log("insuredIdDateStart="+insuredIdDateStart);
						console.log("insuredIdDate="+insuredIdDate);
						console.log("birthday="+birthday);
						if(!changeAvailDataStart(insuredIdDateStart,insuredIdDate,birthday)){
							myFactory.alert("","您填写的被保险人证件有效期不正确，请按证件上的实际有效日期填写！","info");
							myFactory.loadingHide();
							return false;
						}
					}
				}
				//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 end


		 	    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var policyHolderPt = [];//投保人留影数据
				var policyHolderIdPt = [];//投保人身份证明数据
				var insuredPt = [];//被保人留影数据
				var insuredIdPt = [];//被保人身份证明数据
				var benefiPt = [];//受益人留影数据
				var benefiIdPt = [];//受益人身份证明数据
				var bankPt = [];//银行存折/卡留影数据
				var otherPt = [];//其他随附资料留影数据

				var policyHolderPt_500=$("#policyHolderPt_500").val();
				if(policyHolderPt_500!='' && policyHolderPt_500!=undefined){
					policyHolderPt.push(policyHolderPt_500);
				}

				var policyHolderIdPt_501a=$("#policyHolderIdPt_501a").val();
				var policyHolderIdPt_501b=$("#policyHolderIdPt_501b").val();
				// 修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失 add by csf 20181210 start
				if((policyHolderIdPt_501a!='' && policyHolderIdPt_501a!=undefined )||( policyHolderIdPt_501b!='' && policyHolderIdPt_501b!=undefined)){
				// 修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失 add by csf 20181210 end
//				if(policyHolderIdPt_501a!='' && policyHolderIdPt_501a!=undefined && policyHolderIdPt_501b!='' && policyHolderIdPt_501b!=undefined){
					policyHolderIdPt.push(policyHolderIdPt_501a);
					policyHolderIdPt.push(policyHolderIdPt_501b);
				}

				var insuredPt_502=$("#insuredPt_502").val();
				if(insuredPt_502!='' && insuredPt_502!=undefined){
					insuredPt.push(insuredPt_502);
				}

				var insuredIdPt_503a=$("#insuredIdPt_503a").val();
				var insuredIdPt_503b=$("#insuredIdPt_503b").val();
				 //关于被保人身份证明文件相关信息丢失的问题处理 add by csf 20181206 start
				//if(insuredIdPt_503a!='' && insuredIdPt_503a!=undefined && insuredIdPt_503b!='' && insuredIdPt_503b!=undefined){
				if((insuredIdPt_503a!='' && insuredIdPt_503a!=undefined) ||( insuredIdPt_503b!='' && insuredIdPt_503b!=undefined)){
				//关于被保人身份证明文件相关信息丢失的问题处理 add by csf 20181206 end
					insuredIdPt.push(insuredIdPt_503a);
					insuredIdPt.push(insuredIdPt_503b);
				}

				var benefiPt_504=$("#benefiPt_504").val();
				if(benefiPt_504!='' && benefiPt_504!=undefined){
					benefiPt.push(benefiPt_504);
				}

				var benefiIdPt_504a=$("#benefiIdPt_504a").val();
				var benefiIdPt_504b=$("#benefiIdPt_504b").val();
//				if(benefiIdPt_504a!='' && benefiIdPt_504a!=undefined && benefiIdPt_504b!='' && benefiIdPt_504b!=undefined){
				// 修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失 add by csf 20181210 start
				if((benefiIdPt_504a!='' && benefiIdPt_504a!=undefined)||(  benefiIdPt_504b!='' && benefiIdPt_504b!=undefined)){
					// 修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失 add by csf 20181210 end
					benefiIdPt.push(benefiIdPt_504a);
					benefiIdPt.push(benefiIdPt_504b);
				}

				var benefiIdPtDataCheck=$scope.benefiIdPtData;
				var benefitList = photoMainData.benefitList;
				if(benefiIdPtDataCheck.length>0){
					for(var i=0;i<benefiIdPtDataCheck.length;i++) {
						//增加证件有效期校验 add by lb 20220930 start
						if (!benefiIdPtDataCheck[i].checkedY && !benefiIdPtDataCheck[i].checkedN) {
							myFactory.alert('','请核对受益人['+ benefiIdPtDataCheck[i].name + ']证件号码是否一致！','info');
							myFactory.loadingHide();
							return false;
						}
						if (benefiIdPtDataCheck[i].checkedN) {
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件发生变化（或证件号码变更后与证件原件号码不一致），请确认！','info');
							myFactory.loadingHide();
							return false;
						}
						
						//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
						var availDataType = benefiIdPtDataCheck[i].availDataType;
						var availDataStart = benefiIdPtDataCheck[i].availDataStart;
						var availDataClose = benefiIdPtDataCheck[i].availDataClose;
						//有效期起始日校验
						if(availDataStart==""||availDataStart==undefined||availDataStart==null){
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件有效期起始日不能为空!','info');
							myFactory.loadingHide();
							return false;
						}
						if(compareDate(getDate(availDataStart),getDate(sysDate))){
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件有效期起始日必须小于等于当前日!','info');
							myFactory.loadingHide();
							return false;
						}
						if(compareDate(getDate(benefitList[i].birthDay),getDate(availDataStart))){
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件有效期起始日必须小于等于出生日期!','info');
							myFactory.loadingHide();
							return false;
						}
						//有效期截止日校验
						if(availDataType=='2' && (availDataClose==""||availDataClose==undefined||availDataClose==null)){
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件有效期截止日不能为空!','info');
							myFactory.loadingHide();
							return false;
						}
						var availDataCloseStr = "";
						if(availDataClose.indexOf("-")> -1){
							availDataCloseStr = availDataClose.substring(0,4)+availDataClose.substring(5,7)+availDataClose.substring(8,10);
						}
						//调用getDate，参数没有“-”会有问题
						if(availDataType=='2' && !compareDate(getDate(availDataClose),getDate(sysDate))){
							myFactory.alert('','受益人['+ benefiIdPtDataCheck[i].name +']证件有效期截止日应该大于当前日期!','info');
							myFactory.loadingHide();
							return false;
						}
						//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
						//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 start
						if(benefitList[i].idType=="A"){
							if(availDataType=='1'){
								var errormsg = "受益人["+ benefiIdPtDataCheck[i].name +"]的证件类型为'外国人永久居留身份证',有效期类型不可选择长期";
								myFactory.alert("",errormsg,"info");
								myFactory.loadingHide();
								return false;
							}
							if(!changeAvailDataStart(availDataStart,availDataClose,benefitList[i].birthDay)){
								myFactory.alert("",'您填写的受益人['+ benefiIdPtDataCheck[i].name +']证件有效期不正确，请按证件上的实际有效日期填写！',"info");
								myFactory.loadingHide();
								return false;
							}
						}
						//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 end						
						benefitList[i].availDataType = benefiIdPtDataCheck[i].availDataType;
						benefitList[i].availDataStart = benefiIdPtDataCheck[i].availDataStart;
						benefitList[i].availDataClose = benefiIdPtDataCheck[i].availDataClose;
						//增加证件有效期校验 add by lb 20220930 end
						var ida = benefiIdPtDataCheck[i].ida;
						var idb = benefiIdPtDataCheck[i].idb;
						if($("#benefiIdPt_"+ida).val() && $("#benefiIdPt_"+idb).val()){
							benefiIdPt.push($("#benefiIdPt_"+ida).val());
							benefiIdPt.push($("#benefiIdPt_"+idb).val());
						}
					}
				}

				var bankPt_506a=$("#bankPt_506a").val();
				//var bankPt_506b=$("#bankPt_506b").val();
				if(bankPt_506a!='' && bankPt_506a!=undefined){//&& bankPt_506b!='' && bankPt_506b!=undefined
					bankPt.push(bankPt_506a);
					//bankPt.push(bankPt_506b);
				}

				var otherPtDataCheck=$scope.otherPtData;
				for(var i=0;i<otherPtDataCheck.length;i++) {
					var ido = otherPtDataCheck[i].ido;
					var idPt_507="";
					if($("#idPt_"+ido).val()){
						idPt_507=$("#idPt_"+ido).val();
						otherPt.push(idPt_507);
					}
				}

				//传递参数，注意Tomcat要设一个max类型的值，因为数据量太大,否则报错
				var params={
					"holderIdDateType":holderIdDateType,
			 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
                    "holderIdDateStart":holderIdDateStart,
                    "insuredIdDateStart":insuredIdDateStart,
					"benefiIdDateStart":benefiIdDateStart,
			 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					"holderIdDate":holderIdDate,
					"insuredIdDateType":insuredIdDateType,
					"insuredIdDate":insuredIdDate,
					"benefiIdDateType":benefiIdDateType,
					"benefiIdDate":benefiIdDate,

					"policyHolderPt":policyHolderPt,
					"policyHolderIdPt":policyHolderIdPt,
					"insuredPt":insuredPt,
					"insuredIdPt":insuredIdPt,
					"benefiPt":benefiPt,
					"benefiIdPt":benefiIdPt,
					"bankPt":bankPt,
					"otherPt":otherPt
				};

				var photoItems={"photoItems":params};
				//var otherPtTest=otherPt;
				//$timeout(function(){myFactory.loadingHide();},2000); 2秒这里并不足够，采用等待服务器响应比较好
				var token=sessionStorage.getItem("token");
				var timestamp=myFactory.getTimetamp();
				var sfis= "token-timestamp";
				var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				$http({
					method: 'post',
					url: app.domain + frm_photo,
					data:{paramsMap:photoItems,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
				}).then(function successCallback(response) {
					if (response.data.success) {
						var validateMsg = response.data.data.validateMsg;
						if(validateMsg!=""){
							myFactory.alert('',validateMsg,'info');
							myFactory.loadingHide();
							return false;
						}else{
							var redirectAction = response.data.data.redirectAction;
							if(redirectAction!=undefined && redirectAction!=null && redirectAction!=""){
								//结案授权凭证id-一次使用后失效
								//tokenEndAuthorId=response.data.data.tokenEndAuthorId;
								
								//初始化放到end_main再做 BY ZZQ 2017-9-7 
								$interval.cancel($scope.data.timePhoto);//立即终止倒计时
								myFactory.loadingHide();
								$ionicHistory.clearCache().then(function(){
									$state.go('end_main',{
										itemId:itemId,
										chdrnum01:chdrnum01,
										chdrcoy:chdrcoy,
									    photoMainData:photoMainData,
										signMainData:signMainData,
										tokenEndAuthorId:tokenEndAuthorId
									});
								});
								
//								$http({
//									method: 'GET',
//									url: app.domain + redirectAction
//								}).then(function successCallback(response) {
//									var endData = response.data.data.endData;
//									var itemCommonList = response.data.data.endData.itemCommonList;
//									var policy = response.data.data.policy;
//									var strItemIds = response.data.data.strItemIds;
//
//									$interval.cancel($scope.data.timePhoto);//立即终止倒计时
//									myFactory.loadingHide();
//									$state.go('end_main',{
//										itemId:itemId,
//										chdrnum01:chdrnum01,
//										chdrcoy:chdrcoy,
//										itemCommonList:itemCommonList,
//										strItemIds:strItemIds,
//										endData:endData,
//										policy:policy,
//										photoMainData:photoMainData,
//										signMainData:signMainData
//									});
//								}, function errorCallback(response) {
//									myFactory.loadingHide();
//									myFactory.alert('','访问后台失败4，请返回重试','info');
//								});
							}else{
								myFactory.loadingHide();
								$interval.cancel($scope.data.timePhoto);//立即终止倒计时
								myFactory.alert('','系统查询出错，请返回重试','info');
							}
						}
					}else{
						myFactory.loadingHide();
						$interval.cancel($scope.data.timePhoto);//立即终止倒计时
						myFactory.alert('','系统没有响应，请返回重试','info');
					}
				}, function errorCallback(response) {
					myFactory.loadingHide();
					$interval.cancel($scope.data.timePhoto);//立即终止倒计时
					//myFactory.alert('','访问后台失败，请返回重试！','info');
				});
			}

			function submitCheck(){
				var holderIdDate = $("#holderIdDate");
		 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
				var holderIdDateStart = $("#holderIdDateStart");
				var insuredIdDateStart = $("#insuredIdDateStart");
				var benefiIdDateStart = $("#benefiIdDateStart");
		 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
				var insuredIdDate = $("#insuredIdDate");
				var benefiIdDate = $("#benefiIdDate");
				var holderIdDateType = $("#holderIdDateType");
				var insuredIdDateType = $("#insuredIdDateType");
				var benefiIdDateType = $("#benefiIdDateType");

				var checkFlag10=checkIsItemIdType("10");

				//投/被保人
				if(photoRule.policyHolderID=='Y'){
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
					var type =holderIdDateType.val();
					if(type=='1' && photoMainData.ow_idTypeName == "外国人永久居留身份证"){
						/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
						//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 start
						myFactory.alert("","投保人的证件类型为'外国人永久居留身份证',有效期类型不可选择长期","info");
						//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 end
						/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
						return;
					}
					if(type=='2' && !holderIdDate.val()){
						myFactory.alert('','投保人证件有效期不能为空!','info');
						return false;
					}
					//如果证件日期小于当前日期则不允许通过
					
					var hIdDate = holderIdDate.val();
					if(holderIdDate.val().indexOf("-")> -1){
						hIdDate = holderIdDate.val().substring(0,4)+holderIdDate.val().substring(5,7)+holderIdDate.val().substring(8,10);
					}
					console.log("holderIdDate.val()="+holderIdDate.val());
					console.log("sysDate="+sysDate);
					console.log("compareDate(getDate(holderIdDate.val()),getDate(sysDate))="+compareDate(getDate(holderIdDate.val()),getDate(sysDate)));
					if(type=='2' && !compareDate(getDate(holderIdDate.val()),getDate(sysDate))
							&& !(photoMainData.ow_idTypeName=="港澳回乡证" && !compareDate(getDate(sysDate),getDate("2023-12-31")) && hIdDate>=20200101 && hIdDate<=20231230)){
						myFactory.alert('','投保人证件有效期截止日应该大于当前日期!','info');
						return false;
					}
			 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
					
					if(type=='2' && !holderIdDateStart.val()){
						myFactory.alert('','投保人证件有效期起始日不能为空!','info');
						return false;
					}
					
					if(type=='2' && compareDate(getDate(holderIdDateStart.val()),getDate(sysDate))){
						myFactory.alert('','投保人证件有效期起始日必须少于等于当前日!','info');
						return false;
					}
					if(type=='2' && !compareDate(getDate(holderIdDateStart.val()),getDate('20040329'))){
						myFactory.alert('','投保人证件有效期起始日必须大于等于2004年3月29日（二代身份证启用日）!','info');
						return false;
					}
					
			 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
				}

				//被保人
				if(photoRule.insuredID=='Y'){
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
					if(checkFlag10=="N"){
						var type = insuredIdDateType.val();
						if(type=='1' && photoMainData.lf_idTypeName == "外国人永久居留身份证"){
							/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
							//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 start
							myFactory.alert("","被保险人的证件类型为'外国人永久居留身份证',有效期类型不可选择长期","info");
							//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 end
							/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
							return;
						}
						if(type=='2' && !insuredIdDate.val()){
							myFactory.alert('','被保险人证件有效期不能为空!','info');
							return false;
						}
						//如果证件日期小于当前日期则不允许通过
						
						var iIdDate = insuredIdDate.val();
						if(insuredIdDate.val().indexOf("-")> -1){
							iIdDate = insuredIdDate.val().substring(0,4)+insuredIdDate.val().substring(5,7)+insuredIdDate.val().substring(8,10);
						}
						console.log(iIdDate);
						if(type=='2' && !compareDate(getDate(insuredIdDate.val()),getDate(sysDate)) 
								&& !(photoMainData.lf_idTypeName=="港澳回乡证" && !compareDate(getDate(sysDate),getDate("2023-12-31")) && iIdDate>=20200101 && iIdDate<=20231230)){
							myFactory.alert('','被保险人证件有效期截止日应该大于当前日期!','info');
							return false;
						}
						 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
						
						if(type=='2' && !insuredIdDateStart.val()){
							myFactory.alert('','被保险人证件有效期起始日不能为空!','info');
							return false;
						}
						
						if(type=='2' && compareDate(getDate(insuredIdDateStart.val()),getDate(sysDate))){
							myFactory.alert('','被保险人证件有效期起始日必须少于等于当前日!','info');
							return false;
						}
						if(type=='2' && !compareDate(getDate(insuredIdDateStart.val()),getDate('20040329'))){
							myFactory.alert('','被保险人证件有效期起始日必须大于等于2004年3月29日（二代身份证启用日）!','info');
							return false;
						}
						
				 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
					}else{
						var flag = sessionStorage.getItem("isChange_insured_item10");
						//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
						//当变更被保险人或同时变更投保人与被保险人，则才同时需要投保人与被保险人同时签名及身份证件留影。
						//如果被保人信息没有被更改
						if(1==flag){
							var type = insuredIdDateType.val();
							if(type=='1' && photoMainData.lf_idTypeName == "外国人永久居留身份证"){
								/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start*/
								//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 start
								myFactory.alert("","被保险人的证件类型为'外国人永久居留身份证',有效期类型不可选择长期","info");
								//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 update by huanghk 20231116 end
								/*S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end*/
								return;
							}
							if(type=='2' && !insuredIdDate.val()){
								myFactory.alert('','被保险人证件有效期不能为空!','info');
								return false;
							}
							//如果证件日期小于当前日期则不允许通过
							//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
							var iIdDate = insuredIdDate.val();
							if(insuredIdDate.val().indexOf("-")> -1){
								iIdDate = insuredIdDate.val().substring(0,4)+insuredIdDate.val().substring(5,7)+insuredIdDate.val().substring(8,10);
							}
							console.log(iIdDate);
							if(type=='2' && !compareDate(getDate(insuredIdDate.val()),getDate(sysDate)) 
									&& !(photoMainData.lf_idTypeName=="港澳回乡证" && !compareDate(getDate(sysDate),getDate("2023-12-31")) && iIdDate>=20200101 && iIdDate<=20231230)){
								myFactory.alert('','被保险人证件有效期截止日应该大于当前日期!','info');
								return false;
							}
							//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
							 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
							
							if(type=='2' && !insuredIdDateStart.val()){
								myFactory.alert('','被保险人证件有效期起始日不能为空!','info');
								return false;
							}
							
							if(type=='2' && compareDate(getDate(insuredIdDateStart.val()),getDate(sysDate))){
								myFactory.alert('','被保险人证件有效期起始日必须少于等于当前日!','info');
								return false;
							}
							if(type=='2' && !compareDate(getDate(insuredIdDateStart.val()),getDate('20040329'))){
								myFactory.alert('','被保险人证件有效期起始日必须大于等于2004年3月29日（二代身份证启用日）!','info');
								return false;
							}
							
					 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
						}
					}
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
				}

				//权益人
				//if(1==1){
				if(photoRule.benefiID=='Y'&& photoMainData.showBenefiIdDate!='N'){
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
					var type = benefiIdDateType.val();
					if(type=='2' && !benefiIdDate.val()){
						myFactory.alert('','权益人证件有效期不能为空!','info');
						return false;
					}
					//如果证件日期小于当前日期则不允许通过
					
					var bIdDate = benefiIdDate.val();
					if(benefiIdDate.val().indexOf("-")> -1){
						bIdDate = benefiIdDate.val().substring(0,4)+benefiIdDate.val().substring(5,7)+benefiIdDate.val().substring(8,10);
					}
					console.log(bIdDate);
					if(type=='2' && !compareDate(getDate(benefiIdDate.val()),getDate(sysDate))
							&& !(photoMainData.bn_idTypeName=="港澳回乡证" && bIdDate>=20200101 && bIdDate<=20231230)){
						myFactory.alert('','权益人证件有效期截止日应该大于当前日期!','info');
						return false;
					}
					//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
				 }

				//全部拍照数据统一校验
				/*var policyHolderPt=$("#imgshow_policyHolderPt");
				var policyHolderIdPt=$("#imgshow_policyHolderIdPt");
				var insuredPt=$("#imgshow_insuredPt");
				var insuredIdPt=$("#imgshow_insuredIdPt");
				var benefiPt=$("#imgshow_benefiPt");
				var benefiIdPt=$("#imgshow_benefiIdPt");
				var bankPt=$("#imgshow_bankPt");
				var otherPt=$("#imgshow_otherPt");*/

				//投/被保人 投/被保人证件
				if(photoRule.policyHolder=='Y'){
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
//					if(photoMainData.ow_idTypeName=="身份证" && "Y"==isNewHighRefundFeeFlag){
					// S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
					if("Y"==isNewHighRefundFeeFlag || stallShow){
					// S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end	
						if(!verifyStatusOwFlag){
							myFactory.alert('','人脸识别不通过','info');
							return false;
						}
					} else {
						if(!$("#policyHolderPt_500").val()){
							myFactory.alert('','留影不能为空!','info');
							return false;
						}
					}
					
					//身份证，获取扫描证件信息
					/*if(){//从扫描中获取证件，还有确定证件类型为
						
					}
					myFactory.alert('','投保人证件发生变化（或证件号码变更后与证件原件号码不一致），请客户同时办理客户身份信息变更！','info');
					myFactory.loadingHide();*/
					
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				}

				if (photoRule.policyHolderID=='Y'){
					if (photoMainData.ow_idTypeName=="身份证" ){
						if(!$("#policyHolderIdPt_501a").val() || !$("#policyHolderIdPt_501b").val()){
							myFactory.alert('','投保人身份证明留影不能为空!','info');
							return false;
						}
					} else {
						if(!$("#policyHolderIdPt_501a").val() && !$("#policyHolderIdPt_501b").val()){
							myFactory.alert('','投保人身份证明留影不能为空!','info');
							return false;
						}
					}
				}
				//修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失、拦截提示的问题  add by csf 20181210 end
				//被保人 投/被保人证件
				if(photoRule.insured=='Y'){
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
					if(checkFlag10=="N"){
						if( "Y"==isNewHighRefundFeeFlag || stallShow){
							if(!verifyStatusLfFlag){
								myFactory.alert('','人脸识别不通过','info');
								return false;
							}
						}else{
							if(!$("#insuredPt_502").val()){
								myFactory.alert('','被保险人留影不能为空!','info');
								return false;
							}
						}
					}else{
						var flag = sessionStorage.getItem("isChange_insured_item10");
						//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
						//当变更被保险人或同时变更投保人与被保险人，则才同时需要投保人与被保险人同时签名及身份证件留影。
						//如果被保人信息没有被更改
						if(1==flag){
							if( "Y"==isNewHighRefundFeeFlag || stallShow){
								if(!verifyStatusLfFlag){
									myFactory.alert('','人脸识别不通过!','info');
									return false;
								}
							}else{
								if(!$("#insuredPt_502").val()){
									myFactory.alert('','被保险人留影不能为空!','info');
									return false;
								}
							}
						}
					}
					//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
				}

				//if(1==1){
				if(photoRule.insuredID=='Y'){
					//if($("input[name='insuredIdPt']").length<1){
					if(checkFlag10=="N"){
						//修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失、拦截提示的问题  add by csf 20181210 start
						if(photoMainData.lf_idTypeName=="身份证"){
							if(!$("#insuredIdPt_503a").val() || !$("#insuredIdPt_503b").val()){
								myFactory.alert('','被保险人身份证明留影不能为空!','info');
								return false;
							}
						}else {
							if(!$("#insuredIdPt_503a").val() && !$("#insuredIdPt_503b").val()){
								myFactory.alert('','被保险人身份证明留影不能为空!','info');
								return false;
							}
						}
						//修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失、拦截提示的问题  add by csf 20181210 end
					}else{
						var flag = sessionStorage.getItem("isChange_insured_item10");
						//移动保全1.0规则，如只变更投保人信息，则只需要投保人签名及身份证件留影，投保人与被保险人同时核对身份信息是否一致。
						//当变更被保险人或同时变更投保人与被保险人，则才同时需要投保人与被保险人同时签名及身份证件留影。
						if(flag==1){
							//修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失、拦截提示的问题  add by csf 20181210 start
							if(photoMainData.lf_idTypeName=="身份证"){
								if(!$("#insuredIdPt_503a").val() || !$("#insuredIdPt_503b").val()){
									myFactory.alert('','被保险人身份证明留影不能为空!','info');
									return false;
								}
							}else {
								if(!$("#insuredIdPt_503a").val() && !$("#insuredIdPt_503b").val()){
									myFactory.alert('','被保险人身份证明留影不能为空!','info');
									return false;
								}
							}
							//修复投保人/被保人/受益人身份证明文件当只选择一个的时候，会导致受益人身份证明文件无法上传、丢失、拦截提示的问题  add by csf 20181210 end
						}
					}
				}

				//权益人
				if(photoRule.benefi=='Y'){
					var checkFlag08=checkIsItemIdType("08");
					if(checkFlag08=="N"){
						if(!$("#benefiPt_504").val()){
							myFactory.alert('','权益人留影不能为空!','info');
							return false;
						}
					}
				}

				//if(1==1){
				if(photoRule.benefiID=='Y'){//&& photoMainData.showBenefiIdDate!='N'
					var resultRes=checkIsBenefiItemIdType();
					if(resultRes=="N"){
						if(!$("#benefiIdPt_504a").val() || !$("#benefiIdPt_504b").val()){
							myFactory.alert('','权益人身份证明留影不能为空!','info');
							return false;
						}
					}else if(resultRes=="Y_08_S"){
						var checkFlag=true;
						var benefiIdPtDataCheck=$scope.benefiIdPtData;
						for(var i=0;i<benefiIdPtDataCheck.length;i++) {
							var ida = benefiIdPtDataCheck[i].ida;
							var idb = benefiIdPtDataCheck[i].idb;
							//if(!($("#benefiIdPt_"+ida).val()!='' && $("#benefiIdPt_"+idb).val()!='')){
							if(!$("#benefiIdPt_"+ida).val() || !$("#benefiIdPt_"+idb).val()){
								myFactory.alert('','受益人身份证明留影不能为空!','info');
								checkFlag=false;
								break;
							}
						}
						//console.log("testlen:"+$("input[name='benefiIdPt']").length);
						//if($("input[name='benefiIdPt']").length<1){
						if(!checkFlag){
							myFactory.alert('','受益人身份证明留影不能为空!','info');
							return false;
						}
					}else if(resultRes=="Y_08_B"){
						if(!$("#benefiIdPt_504a").val() || !$("#benefiIdPt_504b").val()){
							myFactory.alert('','权益人身份证明留影不能为空!','info');
							return false;
						}
					}else if(resultRes=="Y_08_D"){
						if(!$("#benefiIdPt_504a").val() || !$("#benefiIdPt_504b").val()){
							myFactory.alert('','权益人身份证明留影不能为空!','info');
							return false;
						}

						var checkFlag=true;
						var benefiIdPtDataCheck=$scope.benefiIdPtData;
						for(var i=0;i<benefiIdPtDataCheck.length;i++) {
							var ida = benefiIdPtDataCheck[i].ida;
							var idb = benefiIdPtDataCheck[i].idb;
							if(!$("#benefiIdPt_"+ida).val() || !$("#benefiIdPt_"+idb).val()){
								myFactory.alert('','受益人身份证明留影不能为空!','info');
								checkFlag=false;
								break;
							}
						}
						if(!checkFlag){
							myFactory.alert('','受益人身份证明留影不能为空!','info');
							return false;
						}
					}
				}

				//银行卡
				if(photoRule.bank=='Y'){
					//if($("input[name='bankPt']").length<1){
					/*if(!$("#bankPt_506a").val() || !$("#bankPt_506b").val()){
						myFactory.alert('','银行存折/卡留影不能为空!','info');
						return false;
					}*/
					if(!$("#bankPt_506a").val()){
						myFactory.alert('','银行存折/卡留影不能为空!','info');
						return false;
					}
				}

				//S2018122906735移动保全新增变更项目及功能的优化需求 add by mqz 20200901 start
				if(photoRule.other=='Y'){
					if ("" != strItemIds) {
						var itemIdTypeTemp="";
						var strItemIdsSplit = strItemIds.split(",");
						for(var k=0;k<strItemIdsSplit.length;k++){
							if(strItemIdsSplit[k]=="29" || strItemIdsSplit[k]=="30"){
									var checkFlag=true;
									var otherPtDataCheck=$scope.otherPtData;
									for(var i=0;i<otherPtDataCheck.length;i++) {
										var ido = otherPtDataCheck[i].ido;
										if(!$("#img_otherPt_"+ido).val() || !$("#img_otherPt_"+ido).val()){
											checkFlag=false;
											break;
										}
									}
									if(checkFlag){
										myFactory.alert('','体检报告留影不能为空!','info');
										return false;
									}
							}
						}
					}
				}
			    //S2018122906735移动保全新增变更项目及功能的优化需求 add by mqz 20200901 end
					
				return true;
			}

			//暂时不支持受益人和权益人并存的情况，除非提供受益人可以和具体的那些itemid并存
			function checkIsItemIdType(itemIdType) {
				var checkFlag="N";
				if ("" != strItemIds) {
					var itemIdTypeTemp="";
					var strItemIdsSplit = strItemIds.split(",");
					for(var k=0;k<strItemIdsSplit.length;k++){
						itemIdTypeTemp=strItemIdsSplit[k];
						if(itemIdTypeTemp==itemIdType){
							checkFlag="Y";
							break;
						}
					}
				}
				return checkFlag;
			}
	
			//S2018110706102 - 移动保全受理含“10-更改个人资料”的多项变更，客户签名留影缺失问题 add by csf 20181114  end
			//不存在：N，存在：（1）只存在身故收益人：Y_08_S,(2)存在身故受益人和其他可以并存的权益人：Y_08_M,(3)仅存在其他特殊可以和受益人并存的受益人：Y_08_D，（4）存在其他情况的受益人Y_08_O，在原方法体判断
			function checkIsBenefiItemIdType() {
				var returnResult="N";
				var checkFlag="N";
				var checkFlag_Y_08_S="N";
				var checkFlag_Y_08_B="N";
				var checkFlag_Y_08_D="N";
				//var checkFlag_Y_08_O="N";
				if ("" != strItemIds) {
					var itemIdTypeTemp="";
					var strItemIdsSplit = strItemIds.split(",");
					var lenItem=strItemIdsSplit.length;
					if(lenItem>0){
						for(var k=0;k<lenItem;k++){
							itemIdTypeTemp=strItemIdsSplit[k];
							if(itemIdTypeTemp=="08"){//受益人
								checkFlag_Y_08_S="Y";
								checkFlag="Y";
							}
							//50年金领取方式变更，39生存给付确认，40生存领取方式变更，47生存金领取，43满期金领取  可以和身故受益人并存
							if(itemIdTypeTemp=="50" || itemIdTypeTemp=="39" || itemIdTypeTemp=="40" || itemIdTypeTemp=="47" || itemIdTypeTemp=="43"){//权益人
								checkFlag_Y_08_B="Y";
								checkFlag="Y";
							}
						}
					}
				}
				if(checkFlag=="Y"){
					if(checkFlag_Y_08_S=="Y" && checkFlag_Y_08_B!="Y"){
						returnResult="Y_08_S";
					}else if(checkFlag_Y_08_S!="Y" && checkFlag_Y_08_B=="Y"){
						returnResult="Y_08_B";
					}else if(checkFlag_Y_08_S=="Y" && checkFlag_Y_08_B=="Y"){
						returnResult="Y_08_D";
					}else{
						returnResult="N";
					}
				}

				return returnResult;
			}

			//重新受理
			$scope.renew = function(){
				$interval.cancel($scope.data.timePhoto);
				myFactory.renew();
			}
			//退出移动保全
			$scope.exit = function () {
				console.log('调用了这里')
				$interval.cancel($scope.data.timePhoto);
				myFactory.exit();
			}
			//返回上一页
			$scope.goBack = function(){
				//myFactory.goBack();
				//留影返回上一步骤必须重新计算
				$interval.cancel($scope.data.timePhoto);//返回上一步时停止倒计时
				$ionicHistory.clearCache().then(function(){
					$state.go('photo_sign',{
						itemId:itemId,
						chdrnum01:chdrnum01,
						chdrcoy:chdrcoy,
						signMainData:signMainData
					});
				})
			}

			//保单详情
			$scope.showPolicyDetail = function(){
				modal('open','policyModalOnPhInput','policyWindowOnPhInput','policyCloseXOnPhInput');
				var timestamp=myFactory.getTimetamp();
				var sfis= "chdrnum-chdrcoy-token-timestamp";
				var signStr="chdrnum="+chdrnum01+"&chdrcoy="+chdrcoy+"&token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				//初始化查询订单详情
				var policyData;
				$http({
					method: 'GET',
					url: app.domain + 'query/restFindPolicyDetail.action',
					params: {'chdrnum': chdrnum01,'chdrcoy': chdrcoy,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
				}).then(function successCallback(response) {
					if (response.data.success) {
						policyData = response.data.data;
						$scope.policyData = policyData;
						$scope.policyData.ptdate01=myFactory.DateTools($scope.policyData.ptdate01);
					}
				}, function errorCallback(response) {
					$.alert({
						title: '',
						text: '初始化查询订单详情失败!',
						onOK: function () {
							//点击确认
						}
					});
				});
			}

			//保单详情弹窗关闭
			$scope.policyCancelOnPhInput = function(){
				modal('close','policyModalOnPhInput','policyWindowOnPhInput','policyCloseXOnPhInput');
			}
			
			//图片预览
			$scope.photo_preview = function(id){
				$("#photo_preview1").show();
				var src = $("#"+id).attr("src");
				$("#photo_preview1 .big_photo").attr({"src":src});
				$("#photo_preview1").click(function(){
					$(this).hide();
				});
			}
			
			//转换日期方法  例如：20170225--->2017-02-25 by zzq 2018-3-6
			function DateTools(date){
				date = String(date) ;
				if($.trim(date)!=""){
					return date.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3");
				}else{
					return date;
				}
			}
			
			//拍照日志
			$scope.writePhotoLog = function(logParam){
				/*var logParam={
						"curentPtId":curentPtId,
						"photoDataLog":data
				};*/
				var photoItems={"photoItems":logParam};
				var token=sessionStorage.getItem("token");
				var timestamp=myFactory.getTimetamp();
				var sfis= "token-timestamp";
				var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				$http({
					method: 'post',
					url: app.domain + 'img/writePhotoLog.action',
					data:{paramsMap:photoItems,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
				}).then(function successCallback(response) {
					if (response.data.success) {
						console.log("writePhotoLog ok");
					}
				}, function errorCallback(response) {
					console.log("writePhotoLog error");
				});
			}
			
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 begin
			//根据名字获取正面反面照片base64
			$scope.autoSetItem08IdPic = function(){
				var checkFlag08=checkIsItemIdType("08");//存在身故受益人则获取名字信息
				if(checkFlag08=="Y") {//身故受益人
					var benefiIdPtData=$scope.benefiIdPtData;
					var benefiIdPtDataLen=benefiIdPtData.length;
					if(benefiIdPtDataLen>0){
						//数组参数
						for(var i=0;i < benefiIdPtDataLen;i++){
							name=benefiIdPtData[i].name;
							ida=benefiIdPtData[i].ida;
							idb=benefiIdPtData[i].idb;
							setBenefitBase64Img(name,ida,idb);
						}
					}
				}
			}
			function setBenefitBase64Img(name,ida,idb){
				var itemIdCard08List=photoMainData.itemIdCard08List;
				if(itemIdCard08List!=null & itemIdCard08List!="" && itemIdCard08List.length>0){
					for(var i=0;i < itemIdCard08List.length;i++){
						var bfName=itemIdCard08List[i].bfName;
						var idCardBase64Img0=itemIdCard08List[i].idCardBase64Img0;
						var idCardBase64Img1=itemIdCard08List[i].idCardBase64Img1;
						if(name==bfName){
							if(idCardBase64Img0!=null && idCardBase64Img0!=""){
								$("#img_benefiIdPt_"+ida).attr('src','data:image/gif;base64,'+idCardBase64Img0);
								$("#benefiIdPt_"+ida).val(idCardBase64Img0);
								$("#img_benefiIdPt_"+ida).css('display','inline');
								$("#photo_cover_"+ida).css('display','none');
								$("#text_cover_"+ida).css('display','none');
								$("#delImg_"+ida).css('display','inline');
								
								/*$("#img_benefiIdPt_505_a0").attr('src','data:image/gif;base64,'+testVal);
								$("#benefiIdPt_505_a0").val(testVal);
								$("#img_benefiIdPt_505_a0").css('display','inline');
								$("#photo_cover_505_a0").css('display','none');
								$("#text_cover_505_a0").css('display','none');
								$("#delImg_505_a0").css('display','inline');*/
							}
							if(idCardBase64Img1!=null && idCardBase64Img1!=""){
								$("#img_benefiIdPt_"+idb).attr('src','data:image/gif;base64,'+idCardBase64Img1);
								$("#benefiIdPt_"+idb).val(idCardBase64Img1);
								$("#img_benefiIdPt_"+idb).css('display','inline');
								$("#photo_cover_"+idb).css('display','none');
								$("#text_cover_"+idb).css('display','none');
								$("#delImg_"+idb).css('display','inline');
							}
							break;
						}
					}
				}
			}
			function autoSetItem10IdPic(){
				var itemIdCard10_ow_img0=photoMainData.itemIdCard10_ow_img0;
				var itemIdCard10_ow_img1=photoMainData.itemIdCard10_ow_img1;
				var itemIdCard10_lf_img0=photoMainData.itemIdCard10_lf_img0;
				var itemIdCard10_lf_img1=photoMainData.itemIdCard10_lf_img1;
				
				//alert("itemIdCard10_ow_img0"+itemIdCard10_ow_img0);
				
				setItem10Base64Img(itemIdCard10_ow_img0,"ow","501a");
				setItem10Base64Img(itemIdCard10_ow_img1,"ow","501b");
				setItem10Base64Img(itemIdCard10_lf_img0,"lf","503a");
				setItem10Base64Img(itemIdCard10_lf_img1,"lf","503b");
			}
			function setItem10Base64Img(itemIdCardImg,role,id){
				if(itemIdCardImg!=null && itemIdCardImg!=""){
					if(role=='ow'){
						$("#img_policyHolderIdPt_"+id).attr('src','data:image/gif;base64,'+itemIdCardImg);
						$("#policyHolderIdPt_"+id).val(itemIdCardImg);
						$("#img_policyHolderIdPt_"+id).css('display','inline');
						$("#photo_cover_"+id).css('display','none');
						$("#text_cover_"+id).css('display','none');
						$("#delImg_"+id).css('display','inline');
					}
					if(role=='lf'){
						$("#img_insuredIdPt_"+id).attr('src','data:image/gif;base64,'+itemIdCardImg);
						$("#insuredIdPt_"+id).val(itemIdCardImg);
						$("#img_insuredIdPt_"+id).css('display','inline');
						$("#photo_cover_"+id).css('display','none');
						$("#text_cover_"+id).css('display','none');
						$("#delImg_"+id).css('display','inline');
					}
				}
			}
			
			
			//活体检测/人脸识别
			 $scope.faceVerify = function(context_id,typeName,role){
				if($scope.isPhotoOpenFlag){
					$scope.isPhotoOpenFlag=false;
					setTimeout(function() {
						$scope.isPhotoOpenFlag=true;
					}, 350);
				}else{
					return false;
				}
				
				if(maxTime==0){//如果超出时间限制测不能再拍照
					myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
					return false;
				}
				
				//人脸核身调用调用的接口： 
				//无需参数 
				var data = {}; 
				
				if(curentPtId!=""){
					curentPtId="";
					curentPtTypeName="";
					curentPtRole="";
					appVersionPlat="";
				}
				curentPtId=context_id;
				curentPtTypeName=typeName;
				curentPtRole=role;

				var photoValTemp=$("#"+typeName+"_"+context_id).val();
				if(photoValTemp!=""){
					console.log("there ware a pic");
					return false;
				}
				
				/*if(maxTime==0){//如果超出时间限制测不能再拍照
					myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
					return false;
				}*/
				
				var appVersionFlag = myFactory.getBrowserType();
				console.log("appVersionFlag:"+appVersionFlag);
				if(appVersionFlag=="Android"){
				}else if(appVersionFlag=="IOS"){
				}else if(appVersionFlag=="Browser_test"){
					$("#face_img_"+typeName+"_"+context_id).attr('src','data:image/gif;base64,'+testVal);
					$("#"+typeName+"_"+context_id).val(testVal);
					$("#face_img_"+typeName+"_"+context_id).css('display','inline');
					$("#face_photo_cover_"+context_id).css('display','none');
					$("#face_text_cover_"+context_id).css('display','none');
					$("#face_delImg_"+context_id).css('display','inline');
					//$("#policyHolderPt_500").val(resultImage);
					//$("#insuredPt_502").val(resultImage);
					return false;
				}
				appVersionPlat=appVersionFlag;
				//回调函数 
				/*var callBackFun_livingVerify = function(result){ 
					if(result.data.isSuccess){ 
						var verificationData = result.data.verficationData; 
						//大礼包——该数据是需要后面做人正合一使用的 
						
					}else{ 
						//活体检测原生"没通过" 
					} 
				};*/

				// S2023020825099 TX FaceID add by lvjg 20230625 start

				 var timestamp=myFactory.getTimetamp();
				 var sfis= "token-timestamp";
				 var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				 var sign = myFactory.hex(signStr);
				 $http({
					 method: 'GET',
					 //timeout : 180000, //超时时间设置，单位毫秒
					 url: app.domain + 'img/isTencentFaceLive.action',
					 params: {'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
				 }).then(function successCallback(response) {
					 console.log("isTencentFaceLive: " + response.data)
					 // 1 - 腾讯人脸识别
					 if (response.data == "1") {
						 console.log("role: " + role + ", ow_idTypeName: " + photoMainData.ow_idTypeName + ", lf_idTypeName: " + photoMainData.lf_idTypeName);
						 // 非身份证调用静态活体
						 if (("ow"==role && photoMainData.ow_idTypeName!="身份证") || ("lf"==role && photoMainData.lf_idTypeName!="身份证")) {
							 var photoData = {
								 "openFromGallery" : false,//是否从相册选择照片：true:从相册中选择，false:拍照
								 "imgType" : 'OtherPhoto'//固定值，千万不要改动
							 };
							 cordova.sino.takePhotoOther(callBackFun_Photo_tx, photoData)
						 } else {
							 var face_name;
							 var face_idNo;

							 if (role == "ow") {
								 face_name = face_ow_name;
								 face_idNo = face_ow_idno;
							 } else if (role == "lf"){
								 face_name = face_lf_name;
								 face_idNo = face_lf_idno;
							 }

							 var token=sessionStorage.getItem("token");
							 var timestamp=myFactory.getTimetamp();
							 var sfis= "token-timestamp";
							 var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
							 var sign = myFactory.hex(signStr);
							 $http({
								 method: 'POST',
								 //timeout : 180000, //超时时间设置，单位毫秒
								 url: app.domain + 'img/getTxFaceId.action',
								 data: {
									 'name':face_name,
									 'idNo':face_idNo,
									 'sign':sign,
									 'sfis':sfis,
									 'token':token,
									 'timestamp':timestamp
								 }
							 }).then(function successCallback(response) {
								 console.log(response.data)
								 data = response.data;
								 data["xType"] = "LivenessDetection";
								 console.log("请求XYT参数");
								 console.log(data)

								 /**
								  * callBackFun_livingVerify:回调函数  ，data：参数，目前可不用传
								  */
								 cordova.sino.LivenessDetection(callBackFun_faceVerify_tx, data);//信易通活体检测接口

							 }, function errorCallback(response) {
								 console.log("getTxFaceId error");
								 myFactory.alert('','获取人脸信息失败','info');
								 myFactory.loadingHide();
								 //myFactory.alert("","身份信息校验发生异常!","info");
							 });
						 }
					 } else {
						 /**
						  * callBackFun_livingVerify:回调函数  ，data：参数，目前可不用传
						  */
						 cordova.sino.LivenessDetection(callBackFun_faceVerify, data);//信易通活体检测接口
					 }

				 }, function errorCallback(response) {
					 console.log("isTencentFaceLive error");
					 myFactory.loadingHide();
					 //myFactory.alert("","身份信息校验发生异常!","info");
				 });

				// S2023020825099 TX FaceID add by lvjg 20230625 end


				//callBackFun_faceVerify();//测试回调函数
			}

			// 腾讯静态活体检测回调函数
			var callBackFun_Photo_tx = function(result){
				console.log("腾讯静态活体检测----")
				console.log(result)

				var data = result.data;
				var val = data.Base64Img;//拍照数据

				var token=sessionStorage.getItem("token");
				var timestamp=myFactory.getTimetamp();
				var sfis= "token-timestamp";
				var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				$http({
					method: 'POST',
					//timeout : 180000, //超时时间设置，单位毫秒
					url: app.domain + 'img/detectLiveFace.action',
					data: {
						'Image':val,
						'sign':sign,
						'sfis':sfis,
						'token':token,
						'timestamp':timestamp
					}
				}).then(function successCallback(response) {

					var verificationData = val;
					var faceVerifyStatus=false;

					console.log(response.data)
					data = response.data;

					let errorMsg = data.errorMsg;
					if (typeof errorMsg == 'string' && errorMsg.length > 0){
						myFactory.alert('',errorMsg,'info');
					} else {
						let score = data.score;
						if (score >= 40) {
							console.log("TX静态人脸识别....校验通过!");
							faceVerifyStatus = true;
							if(curentPtRole=="ow"){
								verifyStatusOwFlag = true;
							}else if(curentPtRole=="lf"){
								verifyStatusLfFlag = true;
							}

							if(curentPtRole=="ow"){
								$("#face_img_policyHolderPt_500").attr('src','data:image/gif;base64,'+verificationData);
								$("#policyHolderPt_500").val(verificationData);
								$("#face_img_policyHolderPt_500").css('display','inline');
								$("#face_photo_cover_500").css('display','none');
								$("#face_text_cover_500").css('display','none');
								$("#face_delImg_500").css('display','inline');
								$("#checkImg_500").css('display','none');
							}else if(curentPtRole=="lf"){
								$("#face_img_insuredPt_502").attr('src','data:image/gif;base64,'+verificationData);
								$("#insuredPt_502").val(verificationData);
								$("#face_img_insuredPt_502").css('display','inline');
								$("#face_photo_cover_502").css('display','none');
								$("#face_text_cover_502").css('display','none');
								$("#face_delImg_502").css('display','inline');
								$("#checkImg_502").css('display','none');
							}
						} else {
							faceVerifyStatus = false;
							myFactory.alert('','人脸识别不通过','info');
						}

						var verifyStatus = faceVerifyStatus ? "0" : "1";
						console.log("faceVerifyStatus : " + faceVerifyStatus)
						console.log("verifyStatus : " + verifyStatus)
						var imgId = "";

						if (curentPtRole == "ow") {
							imgId = "checkImg_500";
						}
						if (curentPtRole == "lf") {
							imgId = "checkImg_502";
						}

						updateVerifyResult(imgId,verifyStatus);
					}
				}, function errorCallback(response) {
					console.log("detectLiveFace error");
					myFactory.alert('','人脸活体校验失败','info');
					myFactory.loadingHide();
				});
			};

			// 腾讯活体检测回调函数
			var callBackFun_faceVerify_tx = function(result){

				var verificationData = "";
				var faceVerifyStatus=false;
				//var faceVerifyStatus=true;

				//test
				/*var result = {
						data: {
							isSuccess: "1",
							verificationData: verificationData
						}
				};*/
				console.log("TX活体检测结果----")
				console.log(result)
				if(result.data.isSuccess=="1"){
					verificationData = result.data.verificationData; //verficationData错误
					if(verificationData != undefined || verificationData != null || verificationData != ""){
						faceVerifyStatus = true;

						console.log("TX人证合一....身份信息校验通过!");
						if(curentPtRole=="ow"){
							verifyStatusOwFlag = true;
						}else if(curentPtRole=="lf"){
							verifyStatusLfFlag = true;
						}

						if(curentPtRole=="ow"){
							$("#face_img_policyHolderPt_500").attr('src','data:image/gif;base64,'+verificationData);
							$("#policyHolderPt_500").val(verificationData);
							$("#face_img_policyHolderPt_500").css('display','inline');
							$("#face_photo_cover_500").css('display','none');
							$("#face_text_cover_500").css('display','none');
							$("#face_delImg_500").css('display','inline');
							$("#checkImg_500").css('display','none');
						}else if(curentPtRole=="lf"){
							$("#face_img_insuredPt_502").attr('src','data:image/gif;base64,'+verificationData);
							$("#insuredPt_502").val(verificationData);
							$("#face_img_insuredPt_502").css('display','inline');
							$("#face_photo_cover_502").css('display','none');
							$("#face_text_cover_502").css('display','none');
							$("#face_delImg_502").css('display','inline');
							$("#checkImg_502").css('display','none');
						}

					} else {
						faceVerifyStatus = false;
						myFactory.alert('','人脸识别不通过','info');
					}
				}else{
					//活体检测原生"没通过"
					faceVerifyStatus=false;
					var errorMsg = result.data.sessionState;
					myFactory.alert('',errorMsg,'info');
				}

				var verifyStatus = faceVerifyStatus ? "0" : "1";
				console.log("faceVerifyStatus : " + faceVerifyStatus)
				console.log("verifyStatus : " + verifyStatus)
				var imgId = "";

				if (curentPtRole == "ow") {
					imgId = "checkImg_500";
				}
				if (curentPtRole == "lf") {
					imgId = "checkImg_502";
				}

				updateVerifyResult(imgId,verifyStatus);

			};
			
			//活体检测回调函数 
			var callBackFun_faceVerify = function(result){ 
			//var callBackFun_faceVerify = function(){ 
				
				/*alert("人脸识别返回数据result print："+JSON.stringify(result));
				alert("人脸识别返回数据result："+result);
				alert("人脸识别返回数据result.data："+result.data);
				alert("人脸识别返回数据result.data print："+JSON.stringify(result.data));
				alert("人脸识别返回数据result.data.isSuccess："+result.data.isSuccess);
				alert("人脸识别返回数据verificationData："+result.data.verificationData);
				alert("人脸识别返回数据verficationData："+result.data.verficationData);*/
				
				//var verificationData = "verificationData_big_data";
				var verificationData = "";
				var faceVerifyStatus=false;
				//var faceVerifyStatus=true;
				
				//test
				/*var result = {
						data: {
							isSuccess: "1",
							verificationData: verificationData
						}
				};*/
				if(result.data.isSuccess=="1"){ 
					verificationData = result.data.verificationData; //verficationData错误
					//大礼包——该数据是需要后面做人正合一使用的 
					if(verificationData!=undefined || verificationData!=null || verificationData!=""){
						faceVerifyStatus=true;
					}
				}else{ 
					//活体检测原生"没通过" 
					faceVerifyStatus=false;
				}
				
				/***************writePhotoLog begin******************/
				/*var callXytParam="curentPtId="+curentPtId+",curentPtRole="+curentPtRole+",调用信易通方法：cordova.sino.LivenessDetection(callBackFun_faceVerify, data),参数值内容data[]";
				var logParam={
						"opType":"faceVerify",
						"curentPtId":callXytParam,
						"chdrnum":chdrnum01,
						"photoDataLog":verificationData
				};
				$scope.writePhotoLog(logParam);*/
				/***************writePhotoLog end******************/
				
				if(verificationData==undefined || verificationData==null || verificationData==""){
					return false;
				}else{
					/*if(faceVerifyStatus){//人脸识别通过，根据证件类型做人证合一校验 
						//人证合一校验
						$scope.faceIdCardVerifyIterval(verificationData);
					}else{//人脸识别失败*/		
					//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 start
					 //因为所有证件都需要活体检测，所以需要判断是否时身份证，是的话才需要进行人证合一的检测，不是的话，需要调用思图新的接口,进行验证返回照片
					if(faceVerifyStatus && photoMainData.ow_idTypeName=="身份证"){
						//人证合一校验
						$scope.faceIdCardVerifyIterval(verificationData);
						//测试csf
					} else if(faceVerifyStatus && photoMainData.ow_idTypeName!="身份证"){//其他证件，走新的接口，返回的数据进行照片的填充
						//正式
						$scope.faceContrast(verificationData);
						
						//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end

						
					}else{//人脸识别失败
						//S2018091005428-移动保全人脸核身优化需求 ,任何证件类型都需要走活体检测 add by csf 20181128 end
						if(curentPtRole=="ow"){
							updateVerifyResult('checkImg_500',"1");
						}else if(curentPtRole=="lf"){
							updateVerifyResult('checkImg_502',"1");
						}
						//myFactory.alert("","人脸识别不通过,请重新校验!","info");
					}
				}
			};
			
			//异步调用人证合一接口，用Iterval间接实现angular开启另一个线程
			$scope.faceIdCardVerifyIterval = function(verificationData){
				myFactory.loadingShow();//人证合一校验等待滚动：信易通也是，但是信易通照片都没有返回
				console.log("faceWitnessVerify test...........");
				/*$http({
					method: 'GET',
					url: app.domain + 'img/faceWitnessVerify.action'
				}).then(function successCallback(response) {
					if (response.data.success) {
						//var message = response.data.data.message;
						//console.log("人脸识别成功....."+message);
					}
				}, function errorCallback(response) {
					myFactory.alert("","人脸识别失败!","info");
				});*/
				
				var itemVerify = {
						chdrnum : chdrnum01,
	        			role : curentPtRole,
	        			appVersionPlat : appVersionPlat,
	        			imagePackage : ""
	        	};
				//verificationData = testVal;//测试
				itemVerify.imagePackage=verificationData;
				verificationData="";//清空verificationData大礼包
				
				var itemVerifys={"itemVerify":itemVerify};
				var token=sessionStorage.getItem("token");
				var timestamp=myFactory.getTimetamp();
				var sfis= "token-timestamp";
				var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				//证件类型为身份证，则需要进行人证合一校验
				$http({
				    method: 'POST',
	                //timeout : 180000, //超时时间设置，单位毫秒
	                url: app.domain + 'img/faceIdCardVerify.action',
	                data: {paramsMap:itemVerifys,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}						
				    //data: itemVerify						
				}).then(function successCallback(response) {
					if (response.data.success) {
						//人证合一状态：校验通过0、校验不通过1、不需校验2，校验发生异常-1/-2
						var verifyStatus = response.data.data.verifyStatus;
						console.log("人证合一校验状态....."+verifyStatus);
						if(verifyStatus=="0"){
							if(curentPtRole=="ow"){
								verifyStatusOwFlag=true;
							}else if(curentPtRole=="lf"){
								verifyStatusLfFlag=true;
							}
							//myFactory.alert("","身份信息校验通过!","info");
							console.log("人证合一....身份信息校验通过!");
							
							if(curentPtRole=="ow"){
								var resultImage = response.data.data.resultImage;
								$("#face_img_policyHolderPt_500").attr('src','data:image/gif;base64,'+resultImage);
								$("#policyHolderPt_500").val(resultImage);
								$("#face_img_policyHolderPt_500").css('display','inline');
								$("#face_photo_cover_500").css('display','none');
								$("#face_text_cover_500").css('display','none');
								$("#face_delImg_500").css('display','inline');
								$("#checkImg_500").css('display','none');
							}else if(curentPtRole=="lf"){
								var resultImage = response.data.data.resultImage;
								$("#face_img_insuredPt_502").attr('src','data:image/gif;base64,'+resultImage);
								$("#insuredPt_502").val(resultImage);
								$("#face_img_insuredPt_502").css('display','inline');
								$("#face_photo_cover_502").css('display','none');
								$("#face_text_cover_502").css('display','none');
								$("#face_delImg_502").css('display','inline');
								$("#checkImg_502").css('display','none');
							}
							if(curentPtRole=="ow"){
								updateVerifyResult('checkImg_500',"0");
							}else if(curentPtRole=="lf"){
								updateVerifyResult('checkImg_502',"0");
							}
						}else{
							if(curentPtRole=="ow"){
								verifyStatusOwFlag=false;
								updateVerifyResult('checkImg_500',"1");
							}else if(curentPtRole=="lf"){
								verifyStatusLfFlag=false;
								updateVerifyResult('checkImg_502',"1");
							}
							console.log("人证合一....身份信息校验不通过!");
							myFactory.alert('','人脸识别不通过','info');
						}
					}
					myFactory.loadingHide();
				}, function errorCallback(response) {
					console.log("faceVerify error");
					myFactory.loadingHide();
					//myFactory.alert("","身份信息校验发生异常!","info");
				});
				//return false;
				
				//var maxTime=30;
				//$scope.textFlag = true;
				//$scope.faceIterval = $interval(function(){

					//maxTime--;
					//console.log("timePhoto2:"+maxTime);
					
					//$scope.httpTimeTest();
					
					/*if (maxTime < 1) {
						$interval.cancel($scope.faceIterval);
					} else {
						//$scope.data.timeRest = maxTime;
					}

					if(maxTime==0){
						return false;
					}*/
					
				//}, 1000,1);
			}
			//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
			//调用思图新接口进行人脸验证，返回图片
			$scope.faceContrast = function(verificationData){
				myFactory.loadingShow();//人证合一校验等待滚动：信易通也是，但是信易通照片都没有返回
				console.log("faceWitnessVerify test...........");
				var itemVerify = {
						chdrnum : chdrnum01,
	        			role : curentPtRole,
	        			appVersionPlat : appVersionPlat,
	        			imagePackage : ""
	        	};
				//verificationData = testVal;//测试
				itemVerify.imagePackage=verificationData;
				verificationData="";//清空verificationData大礼包
				
				var itemVerifys={"itemVerify":itemVerify};
				var token=sessionStorage.getItem("token");
				var timestamp=myFactory.getTimetamp();
				var sfis= "token-timestamp";
				var signStr="token="+token+"&timestamp="+timestamp;//encodeURI(name)
				var sign = myFactory.hex(signStr);
				$http({
				    method: 'POST',
	                url: app.domain + 'img/faceIdCardVerify.action',
	                data: {paramsMap:itemVerifys,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}										
				}).then(function successCallback(response) {
					if (response.data.success) {
						//人证合一状态：校验通过0、校验不通过1
						var verifyStatus = response.data.data.verifyStatus;
						console.log("人证合一校验状态....."+verifyStatus);
						if(verifyStatus=="0"){
							if(curentPtRole=="ow"){
								verifyStatusOwFlag=true;
							}else if(curentPtRole=="lf"){
								verifyStatusLfFlag=true;
							}		
							if(curentPtRole=="ow"){
								var resultImage = response.data.data.resultImage;
								$("#face_img_policyHolderPt_500").attr('src','data:image/gif;base64,'+resultImage);
								$("#policyHolderPt_500").val(resultImage);
								$("#face_img_policyHolderPt_500").css('display','inline');
								$("#face_photo_cover_500").css('display','none');
								$("#face_text_cover_500").css('display','none');
								$("#face_delImg_500").css('display','inline');
								$("#checkImg_500").css('display','none');
							}else if(curentPtRole=="lf"){
								var resultImage = response.data.data.resultImage;
								$("#face_img_insuredPt_502").attr('src','data:image/gif;base64,'+resultImage);
								$("#insuredPt_502").val(resultImage);
								$("#face_img_insuredPt_502").css('display','inline');
								$("#face_photo_cover_502").css('display','none');
								$("#face_text_cover_502").css('display','none');
								$("#face_delImg_502").css('display','inline');
								$("#checkImg_502").css('display','none');
							}
							if(curentPtRole=="ow"){
								updateVerifyResult('checkImg_500',"0");
							}else if(curentPtRole=="lf"){
								updateVerifyResult('checkImg_502',"0");
							}
						}else{
							if(curentPtRole=="ow"){
								verifyStatusOwFlag=false;
								updateVerifyResult('checkImg_500',"1");
							}else if(curentPtRole=="lf"){
								verifyStatusLfFlag=false;
								updateVerifyResult('checkImg_502',"1");
							}
							myFactory.alert('','人脸识别不通过','info');
						}
					}
					myFactory.loadingHide();
				}, function errorCallback(response) {
					myFactory.loadingHide();
				});
			}
			//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128  end
			//人脸识别结果勾显示成功或者失败状态
			function updateVerifyResult(id,faceVerifyStatus){
				$("#"+id).show();
				if(faceVerifyStatus=="0"){
					$("#"+id).attr({"src":"images/face_success.png"});
				}else{
					$("#"+id).attr({"src":"images/face_fail.png"});
				}
			}
			
			//投保人、被保人人脸核身与拍照留影切换
			function facePageChange(idFs,idPt,idCheck){
				if($("#"+idFs).css("display")=="none"){
					$("#"+idFs).show();
					$("#"+idPt).hide();
					//去除勾或叉
					$("#"+idCheck).hide();
				}else{
					$("#"+idFs).hide();
					$("#"+idPt).show();
				}
			}
			
			$scope.item08IdPicIterval = function(){
				var maxTime=2;
				$scope.autoItem08IdPicIterval = $interval(function(){
					maxTime--;
					console.log("item08IdPicIterval begin...........maxTime="+maxTime);
					if (maxTime < 1) {
						$interval.cancel($scope.autoItem08IdPicIterval);
						//页面元素还没加载，借用倒计时线程来触发受益人自动化获取证件图片
						console.log("showProfitIdPtFlag"+$scope.showProfitIdPtFlag);
						if($scope.showProfitIdPtFlag){
							console.log("*************autoSetItem08IdPic begin*************");
							$scope.autoSetItem08IdPic();
							console.log("*************autoSetItem08IdPic end*************");
							//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
							console.log("*************autoSetItem08Date begin*************");
							$scope.autoSetItem08Date();
							console.log("*************autoSetItem08Date end*************");
							//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end
						}
					}
				}, 1000,2);
			}
			
			//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 start
			$scope.autoSetItem08Date = function(){
				var checkFlag08=checkIsItemIdType("08");//存在身故受益人则获取名字信息
				if(checkFlag08=="Y") {//身故受益人
					var benefiIdPtData=$scope.benefiIdPtData;
					var benefiIdPtDataLen=benefiIdPtData.length;
					if(benefiIdPtDataLen>0){
						//数组参数
						var ida = "";
						var availDataStart = "";
						var availDataClose = "";
						for(var i=0;i < benefiIdPtDataLen;i++){
							ida=benefiIdPtData[i].ida;
							availDataStart = benefiIdPtData[i].availDataStart;
							availDataClose = benefiIdPtData[i].availDataClose;
							if(benefiIdPtData[i].idType!="1"){
								myFactory.initDateUtil('benfIdDateStart_'+ida,DateTools(availDataStart));
								if(benefiIdPtData[i].availDataType=="1"){
									myFactory.initDateUtil('benfIdDate_'+ida,"");
									$("#benfIdDate_"+benfIdDate_).val("");
								}else{
									myFactory.initDateUtil('benfIdDate_'+ida,DateTools(availDataClose));
								}
							}
						}
					}
				}
			}
			//S2023051626072港澳居民来往内地通行证有效期延长系统需求 update by huanghk 20230529 end

			//PC端开发测试用
			/*var testVal="R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7";
			var result = {
				data : {
					Name:"冯冠涛",
					Sex:"男",
					Birthday:"1990-05-27",
					//Id:"440771201503231715",
					Id:"441223199005274713",
					Address:"广东省广州市天河区某街道23号",
					Validity:"2050-08-23",
					//Validity:"长期",
					smallPic:testVal,
					bigPic:testVal,
					ok:"true",
					//isFront:true,//正面
					isFront:false,//反面
				}
			};*/
			//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
			//增加参数isFront， 用来判断点击扫描的页面区域是正面扫描还是反面进行的
			$scope.scanIdcardPictures = function(context_id,typeName,role,scanName,isFront){
			//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 end
				/*if($scope.isPhotoOCRFlag){
					$scope.isPhotoOCRFlag=false;
					setTimeout(function() {
						$scope.isPhotoOCRFlag=true;
					}, 350);
				}else{
					return false;
				}*/
				if(maxTime==0){//如果超出时间限制测不能再拍照
					myFactory.alert('','拍摄超时，请返回上一步重新处理','info');
					return false;
				}
				if("OW"==role && photoMainData.ow_idTypeName!="身份证"){
					$scope.takePictures(context_id,typeName);
				}else if("LF"==role && photoMainData.lf_idTypeName!="身份证"){
					$scope.takePictures(context_id,typeName);
				}else if("BF"==role){
					//根据人员scanName确定证件类型
					var benefitList=photoMainData.benefitList;
					var idType="";
					if(benefitList!=null & benefitList!="" && benefitList.length>0){
						for(var i=0;i < benefitList.length;i++){
							var bfName=benefitList[i].name;
							if(scanName==bfName){
								idType=benefitList[i].idType;
								break;
							}
						}
					}
					//alert("idType="+idType);
					if("1"!=idType){//证件类型非身份证，则拍照
						$scope.takePictures(context_id,typeName);
					}else{//受益人、证件OCR
						scanIDCardInfoPic(context_id,typeName,role,scanName,isFront);
					}
				}else{
					scanIDCardInfoPic(context_id,typeName,role,scanName,isFront);
				}
			}
			
			function scanIDCardInfoPic(context_id,typeName,role,scanName,isFront){
				if($scope.isPhotoOCRFlag){
					$scope.isPhotoOCRFlag=false;
					setTimeout(function() {
						$scope.isPhotoOCRFlag=true;
					}, 350);
				}else{
					return false;
				}
				$scope.curentPtBfName=scanName;
				if(curentPtId!=""){
					curentPtId="";
					curentPtTypeName="";
				}
				curentPtId=context_id;
				curentPtTypeName=typeName;
				
				var photoValTemp=$("#"+typeName+"_"+context_id).val();
				if(photoValTemp!=""){
					console.log("there ware a pic");
					return false;
				}
				//移动端
				cordova.sino.getIDCardInfo(function(result){
					if(result.success){
						if(!result.data.exit){
							if(appVersion==="IOS"){
								if(result.data.ok){
									//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
									//身份证正面只能扫描身份证正面信息，不能扫描反面，反之亦然
									if (isFront === 'Y'){
										//身份证正面
										//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 end
										if(result.data.isFront){

											//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
//											var name=result.data.Name;
//											var sex=result.data.Sex;
//											var birthday=result.data.Birthday;
											var id =result.data.Id;//证件号码
//											var address=result.data.Address;
											var idCardSmallPic=result.data.smallPic;
											var idCardBigPic=result.data.bigPic;
//											checkAndSetIdcardInfo(id,name,sex,birthday,role,curentPtId,curentPtTypeName,idCardBigPic,$scope.curentPtBfName);
											checkAndSetIdcardInfo(id,role,curentPtId,curentPtTypeName,idCardBigPic,$scope.curentPtBfName);
											//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
										} else {
											myFactory.alert('注意','证件正面区域只能扫描身份证正面，请重新扫描！','info');
											return
										}
									}else{
										//身份证反面
										//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
										if (isFront === 'N'){
											if(result.data.isFront){
												myFactory.alert('注意','证件反面区域只能扫描身份证反面，请重新扫描！','info');
												return
											}
										//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 end
										var validity=result.data.Validity;//有效期
										//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
										var oldValidity=result.data.OldValidity;//有效期
										var idCardSmallPic=result.data.smallPic;
										var idCardBigPic=result.data.bigPic;
										var isPerpetual = validity == '长期';
										//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
										if (checkFlag10 == 'Y'){
											if(!checkCradValidity(validity,role)){
												myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
												return;
											}
											if(!checkCradOldValidity(oldValidity,role)){
												myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
												return;
											}
										}
										
										if (checkFlag10 == 'N' && role =='BF'){
											if(!checkCradValidity(validity,role)){
												myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
												return;
											}
											if(!checkCradOldValidity(oldValidity,role)){
												myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
												return;
											}
											//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end

										}
										//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
										//信易通OCR身份证有效期校验 add by lb 20220926 start
										if ("OW" == role) {
											var owIdNo = photoMainData.ow_idNo;
											var brithDay = owIdNo.substr(6, 4) + "-" + owIdNo.substr(10, 2) + "-" + owIdNo.substr(12, 2);
											if (!checkIdCardDate(brithDay, oldValidity, validity)
												|| (!isPerpetual &&(!compareDate(getDate(validity),getDate(sysDate))
												|| compareDate(getDate(oldValidity),getDate(sysDate))
												|| !compareDate(getDate(oldValidity),getDate('20040329'))))
											) {
												myFactory.alert("", "投保人证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
												return;
											}
										} else if ("LF" == role) {
											var lfIdNo = photoMainData.lf_idNo;
											var brithDay = lfIdNo.substr(6, 4) + "-" + lfIdNo.substr(10, 2) + "-" + lfIdNo.substr(12, 2);
											if (!checkIdCardDate(brithDay, oldValidity, validity)
												|| (!isPerpetual &&(!compareDate(getDate(validity),getDate(sysDate))
												|| compareDate(getDate(oldValidity),getDate(sysDate))
												|| !compareDate(getDate(oldValidity),getDate('20040329'))))
											) {
												myFactory.alert("", "被保人证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
												return;
											}
										} else if ("BF" == role) {
											var benefitList = photoMainData.benefitList;
											var birthday = "";
											if (benefitList != null && benefitList != "" && benefitList.length > 0) {
												for (var i = 0; i < benefitList.length; i++) {
													if ($scope.curentPtBfName == benefitList[i].name) {
														birthday = benefitList[i].birthDay;
														break;
													}
												}
											}
											if (!checkIdCardDate(birthday, oldValidity, validity)
												|| (!isPerpetual && (!compareDate(getDate(validity),getDate(sysDate))
												|| compareDate(getDate(oldValidity),getDate(sysDate))
												|| !compareDate(getDate(oldValidity),getDate('20040329'))))
											) {
												myFactory.alert("", "受益人【" + $scope.curentPtBfName + "】证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
												return;
											}
										}
										//信易通OCR身份证有效期校验 add by lb 20220926 end
										
										//存在有效期为长期的情况：
										if("OW"==role){
											var ow_availDataType="";
											//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
											var ow_availDataStart="";
											//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
											var ow_availDataClose="";
											if(validity=='长期' || validity=='终身'){
												ow_availDataType="1";
												//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
												ow_availDataStart=oldValidity;
												ow_availDataClose="";
												//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
											}else{
												ow_availDataType="2";
												//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
												ow_availDataStart=oldValidity;
												//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
												ow_availDataClose=validity;  
											}
											$("#holderIdDateType").val(ow_availDataType);
											$scope.holderIdDateTypeSelect = ow_availDataType;
											var options_holder =$("#holderIdDateType option:selected");
											$scope.holderCreTypeName=options_holder.text();
											//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
											$scope.photoMainData.ow_availDataStart=ow_availDataStart;
											myFactory.initDateUtil('holderIdDateStart',ow_availDataStart);
											if(ow_availDataType=="1"){
												$scope.photoMainData.ow_availDataClose="";
												myFactory.initDateUtil('holderIdDate','');
												$("#holderIdDate").val("");
											}else{
												$scope.photoMainData.ow_availDataClose=ow_availDataClose;
												myFactory.initDateUtil('holderIdDate',ow_availDataClose);
											}
										}else if("LF"==role){
											var lf_availDataType="";
											 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
											var lf_availDataStart="";
											var lf_availDataClose="";
											if(validity=='长期' || validity=='终身'){
												lf_availDataType="1";
												lf_availDataStart=oldValidity;
												lf_availDataClose="";
											}else{
												lf_availDataType="2";
												lf_availDataStart=oldValidity;
												 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
												lf_availDataClose=validity;
											}
											$("#insuredIdDateType").val(lf_availDataType);
											$scope.insuredIdDateTypeSelect = lf_availDataType;
											var options_insured =$("#insuredIdDateType option:selected");
											$scope.insuredCreTypeName=options_insured.text();
											myFactory.initDateUtil('insuredIdDate','');
											
											//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
											$scope.photoMainData.lf_availDataStart=lf_availDataStart;
											myFactory.initDateUtil('insuredIdDateStart',lf_availDataStart);
											if(lf_availDataType=="1"){
												$scope.photoMainData.lf_availDataClose="";
												myFactory.initDateUtil('insuredIdDate','');
												$("#insuredIdDate").val("");
											}else{
												$scope.photoMainData.lf_availDataClose=lf_availDataClose;
												myFactory.initDateUtil('insuredIdDate',lf_availDataClose);
											}
											 //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end

										//信易通OCR身份证有效期校验 add by lb 20220926 start
										}else if("BF"==role){
											var bf_availDataType="";
											var bf_availDataStart="";
											var bf_availDataClose="";
											if(validity=='长期' || validity=='终身'){
												bf_availDataType="1";
												bf_availDataStart=oldValidity;
											}else{
												bf_availDataType="2";
												bf_availDataStart=oldValidity;
												bf_availDataClose=validity;
											}
											var benefitList = $scope.benefiIdPtData;
											if (benefitList != null && benefitList != "" && benefitList.length > 0) {
												for (var i = 0; i < benefitList.length; i++) {
													if ($scope.curentPtBfName == benefitList[i].name) {
														benefitList[i].availDataType = bf_availDataType;
														benefitList[i].availDataTypeCN = bf_availDataType == '2' ? '年期' : '长期';
														benefitList[i].availDataStart = bf_availDataStart;//有效期起始日
														benefitList[i].availDataClose = bf_availDataClose;//有效期截至日
														break;
													}
												}
											}
										}
										//信易通OCR身份证有效期校验 add by lb 20220926 end
										setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
									}
								}
								}
							}else{
								$scope.smallPic=result.data.smallPic;
					            $scope.bigPic=result.data.bigPic;
					            result.data.smallPic="";
								result.data.bigPic="";
								cordova.sino.confirmIDCardInfo(function(result){
									if(result.success){
										if(result.data.ok){
											//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
											//身份证正面只能扫描身份证正面信息，不能扫描反面，反之亦然
											if (isFront === 'Y'){
												//身份证正面
												//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 end
											if(result.data.isFront){
												//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
//												var name=result.data.Name;
//												var sex=result.data.Sex;
//												var birthday=result.data.Birthday;
												var id =result.data.Id;//证件号码
//												var address=result.data.Address;
												
//												checkAndSetIdcardInfo(id,name,sex,birthday,role,curentPtId,curentPtTypeName,$scope.bigPic,$scope.curentPtBfName);
												checkAndSetIdcardInfo(id,role,curentPtId,curentPtTypeName,$scope.bigPic,$scope.curentPtBfName);

												//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
												$scope.smallPic="";
												$scope.bigPic="";
												} else {
													myFactory.alert('注意','证件正面区域只能扫描身份证正面，请重新扫描！','info');
													return
												}
											}else{
												//身份证反面
												//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 start
												if (isFront === 'N'){
													if(result.data.isFront){
														myFactory.alert('注意','证件反面区域只能扫描身份证反面，请重新扫描！','info');
														return
													}
												//S2018091005428-移动保全人脸核身优化需求 add by csf 20181128 end
												//身份证反面
												var validity=result.data.Validity;//有效期
											     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
												var oldValidity=result.data.OldValidity;//有效期
											     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
												var isPerpetual = validity == '长期';
												//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
												if (checkFlag10 == 'Y'){
													if(!checkCradValidity(validity,role)){
														myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
														return;
													}
												     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
													if(!checkCradOldValidity(oldValidity,role)){
														myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
														return;
													}
												}
												
												if (checkFlag10 == 'N' && role =='BF'){
													if(!checkCradValidity(validity,role)){
														myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
														return;
													}
													if(!checkCradOldValidity(oldValidity,role)){
														myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
														return;
													}
												     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
												}
												//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end

												//信易通OCR身份证有效期校验 add by lb 20220926 start
												if ("OW" == role) {
													var owIdNo = photoMainData.ow_idNo;
													var brithDay = owIdNo.substr(6, 4) + "-" + owIdNo.substr(10, 2) + "-" + owIdNo.substr(12, 2);
													if (!checkIdCardDate(brithDay, oldValidity, validity)
														|| (!isPerpetual &&(!compareDate(getDate(validity),getDate(sysDate))
														|| compareDate(getDate(oldValidity),getDate(sysDate))
														|| !compareDate(getDate(oldValidity),getDate('20040329'))))
													) {
														myFactory.alert("", "投保人证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
														return;
													}
												} else if ("LF" == role) {
													var lfIdNo = photoMainData.lf_idNo;
													var brithDay = lfIdNo.substr(6, 4) + "-" + lfIdNo.substr(10, 2) + "-" + lfIdNo.substr(12, 2);
													if (!checkIdCardDate(brithDay, oldValidity, validity)
														|| (!isPerpetual &&(!compareDate(getDate(validity),getDate(sysDate))
														|| compareDate(getDate(oldValidity),getDate(sysDate))
														|| !compareDate(getDate(oldValidity),getDate('20040329'))))
													) {
														myFactory.alert("", "被保人证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
														return;
													}
												} else if ("BF" == role) {
													var benefitList = photoMainData.benefitList;
													var birthday = "";
													if (benefitList != null && benefitList != "" && benefitList.length > 0) {
														for (var i = 0; i < benefitList.length; i++) {
															if ($scope.curentPtBfName == benefitList[i].name) {
																birthday = benefitList[i].birthDay;
																break;
															}
														}
													}
													if (!checkIdCardDate(birthday, oldValidity, validity)
														|| (!isPerpetual &&(!compareDate(getDate(validity),getDate(sysDate))
														|| compareDate(getDate(oldValidity),getDate(sysDate))
														|| !compareDate(getDate(oldValidity),getDate('20040329'))))
													) {
														myFactory.alert("", "受益人" + $scope.curentPtBfName + "证件有效期错误，请核对信息，若不一致请重新拍照。", "info");
														return;
													}
												}
												//信易通OCR身份证有效期校验 add by lb 20220926 end
												
												//checkAndSetIdcardInfo(id,name,sex,birthday,role,curentPtId,curentPtTypeName,idCardBigPic);
												//存在有效期为长期的情况：
												if("OW"==role){
													var ow_availDataType="";
													var ow_availDataClose="";
											 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
													var ow_availDataStart="";
											 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
													if(validity=='长期' || validity=='终身'){
														ow_availDataType="1";
														//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
														ow_availDataStart=oldValidity;
														ow_availDataClose="";
													    //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
													}else{
														ow_availDataType="2";
													     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
														ow_availDataStart=oldValidity;
													     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
														ow_availDataClose=validity;
													}
													$("#holderIdDateType").val(ow_availDataType);
													$scope.holderIdDateTypeSelect = ow_availDataType;
													var options_holder =$("#holderIdDateType option:selected");
													$scope.holderCreTypeName=options_holder.text();
													//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
													$scope.photoMainData.ow_availDataStart=ow_availDataStart;
													myFactory.initDateUtil('holderIdDateStart',ow_availDataStart);
													if(ow_availDataType=="1"){
														$scope.photoMainData.ow_availDataClose="";
														myFactory.initDateUtil('holderIdDate','');
														$("#holderIdDate").val("");
													}else{
														$scope.photoMainData.ow_availDataClose=ow_availDataClose;
														myFactory.initDateUtil('holderIdDate',ow_availDataClose);
													}
											 	     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
												}else if("LF"==role){
													var lf_availDataType="";
													var lf_availDataClose="";
													if(validity=='长期' || validity=='终身'){
														lf_availDataType="1";
														//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
														lf_availDataStart=oldValidity;
														lf_availDataClose="";
													     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
													}else{
														lf_availDataType="2";
													     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
														lf_availDataStart=oldValidity;
													     //S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
														lf_availDataClose=validity;
													}
													$("#insuredIdDateType").val(lf_availDataType);
													$scope.insuredIdDateTypeSelect = lf_availDataType;
													var options_insured =$("#insuredIdDateType option:selected");
													$scope.insuredCreTypeName=options_insured.text();
													myFactory.initDateUtil('insuredIdDate','');
													
													//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
													$scope.photoMainData.lf_availDataStart=lf_availDataStart;
													myFactory.initDateUtil('insuredIdDateStart',lf_availDataStart);
													if(lf_availDataType=="1"){
														$scope.photoMainData.lf_availDataClose="";
														myFactory.initDateUtil('insuredIdDate','');
														$("#insuredIdDate").val("");
													}else{
														$scope.photoMainData.lf_availDataClose=lf_availDataClose;
														myFactory.initDateUtil('insuredIdDate',lf_availDataClose);
													}
													
													//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end 
												//信易通OCR身份证有效期校验 add by lb 20220926 start
												}else if("BF"==role){
													var bf_availDataType="";
													var bf_availDataStart="";
													var bf_availDataClose="";
													if(validity=='长期' || validity=='终身'){
														bf_availDataType="1";
														bf_availDataStart=oldValidity;
													}else{
														bf_availDataType="2";
														bf_availDataStart=oldValidity;
														bf_availDataClose=validity;
													}
													var benefitList = $scope.benefiIdPtData;
													if (benefitList != null && benefitList != "" && benefitList.length > 0) {
														for (var i = 0; i < benefitList.length; i++) {
															if ($scope.curentPtBfName == benefitList[i].name) {
																benefitList[i].availDataType = bf_availDataType;
																benefitList[i].availDataTypeCN = bf_availDataType == '2' ? '年期' : '长期';
																benefitList[i].availDataStart = bf_availDataStart;//有效期起始日
																benefitList[i].availDataClose = bf_availDataClose;//有效期截至日
																break;
															}
														}
													}
												}
												//信易通OCR身份证有效期校验 add by lb 20220926 end
												setIdCardPic(curentPtId,curentPtTypeName,$scope.bigPic);
												$scope.smallPic="";
												$scope.bigPic="";
											}
												else {
													myFactory.alert('注意','证件反面区域只能扫描身份证反面，请重新扫描！','info');
													return
												}
											}
										}
									}
								},result.data);
							}
							
							
							
							
							
						}
					}
				//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
				},{canModify : true});				
				//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
				/*if(result.data.ok){
					if(result.data.isFront){
						//身份证正面
						var name=result.data.Name;
						var sex=result.data.Sex;
						var birthday=result.data.Birthday;
						var id =result.data.Id;//证件号码
						var address=result.data.Address;
						var idCardSmallPic=result.data.smallPic;
						var idCardBigPic=result.data.bigPic;
						checkAndSetIdcardInfo(id,name,sex,birthday,role,curentPtId,curentPtTypeName,idCardBigPic);
					}else{
						//身份证反面
						var validity=result.data.Validity;//有效期
						var idCardSmallPic=result.data.smallPic;
						var idCardBigPic=result.data.bigPic;
						
						//存在有效期为长期的情况：
						if("OW"==role){
							var ow_availDataType="";
							var ow_availDataClose="";
							if(validity=='长期' || validity=='终身'){
								ow_availDataType="1";
							}else{
								ow_availDataType="2";
								ow_availDataClose=validity;
							}
							$("#holderIdDateType").val(ow_availDataType);
							$scope.holderIdDateTypeSelect = ow_availDataType;
							var options_holder =$("#holderIdDateType option:selected");
							$scope.holderCreTypeName=options_holder.text();

							if(ow_availDataType=='2'){
								if(ow_availDataClose!="" && ow_availDataClose!=null && ow_availDataClose!=undefined){
									$scope.photoMainData.ow_availDataClose=ow_availDataClose;
									myFactory.initDateUtil('holderIdDate',ow_availDataClose);
								}else{
									myFactory.initDateUtil('holderIdDate','');
								}
							}else{
								myFactory.initDateUtil('holderIdDate','');
							}
						}else if("LF"==role){
							var lf_availDataType="";
							var lf_availDataClose="";
							if(validity=='长期' || validity=='终身'){
								lf_availDataType="1";
							}else{
								lf_availDataType="2";
								lf_availDataClose=validity;
							}
							$("#insuredIdDateType").val(lf_availDataType);
							$scope.insuredIdDateTypeSelect = lf_availDataType;
							var options_insured =$("#insuredIdDateType option:selected");
							$scope.insuredCreTypeName=options_insured.text();
							myFactory.initDateUtil('insuredIdDate','');
							
							if(lf_availDataType=='2'){
								if(lf_availDataClose!="" && lf_availDataClose!=null && lf_availDataClose!=undefined){
									$scope.photoMainData.lf_availDataClose=lf_availDataClose;
									myFactory.initDateUtil('insuredIdDate',lf_availDataClose);
								}else{
									myFactory.initDateUtil('insuredIdDate','');
								}
							}
						}
						setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
					}
				}*/
			}

			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
			function checkCradValidity(validity,role){
			//	var cacheDateClose;
				if("OW"==role){
					if ( typeof photoMainData.ow_availDataClose == 'number' ){
						photoMainData.ow_availDataClose = photoMainData.ow_availDataClose.toString();
						photoMainData.ow_availDataClose = photoMainData.ow_availDataClose.substring(0,4) +"-"+photoMainData.ow_availDataClose.substring(4,6)+"-"+photoMainData.ow_availDataClose.substring(6,8)
					}
					if(validity != photoMainData.ow_availDataClose && photoMainData.ow_availDataClose != ''){
						return false;
					}
				}else if("LF"==role){
					if ( typeof photoMainData.lf_availDataClose == 'number' ) {
						photoMainData.lf_availDataClose = photoMainData.lf_availDataClose.toString();
						photoMainData.lf_availDataClose = photoMainData.lf_availDataClose.substring(0,4) +"-"+photoMainData.lf_availDataClose.substring(4,6)+"-"+photoMainData.lf_availDataClose.substring(6,8)
					}
					if(validity != photoMainData.lf_availDataClose && photoMainData.lf_availDataClose != ''){
						return false;
					}
				}else if("BF"==role){
					var bf_availDataClose="";
					var bf_name="";
					var benefitList=photoMainData.benefitList;
					if(benefitList!=null & benefitList!="" && benefitList.length>0){
						for(var i=0;i < benefitList.length;i++){
							bf_name=benefitList[i].name;
							if($scope.curentPtBfName==bf_name){
								bf_availDataClose=benefitList[i].availDataClose;
								break;
							}
						}
					}
					if(validity != bf_availDataClose && bf_availDataClose != '' && bf_availDataClose != '99999999'){
						return false;
					}
				}
				return true;
			}
			//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 start
			function checkCradOldValidity(oldValidity,role){
				    if("OW"==role){
						if ( typeof photoMainData.ow_availDataStart == 'number' ){
							photoMainData.ow_availDataStart = photoMainData.ow_availDataStart.toString();
						}
						if(photoMainData.ow_availDataStart.indexOf("-") == -1){
							photoMainData.ow_availDataStart = photoMainData.ow_availDataStart.substring(0,4) +"-"+photoMainData.ow_availDataStart.substring(4,6)+"-"+photoMainData.ow_availDataStart.substring(6,8);
						}
						if(oldValidity != photoMainData.ow_availDataStart && photoMainData.ow_availDataStart != ''){
							return false;
						}
					}else if("LF"==role){
						if ( typeof photoMainData.lf_availDataStart == 'number' ) {
							photoMainData.lf_availDataStart = photoMainData.lf_availDataStart.toString();
							//photoMainData.lf_availDataStart = photoMainData.lf_availDataStart.substring(0,4) +"-"+photoMainData.lf_availDataStart.substring(4,6)+"-"+photoMainData.lf_availDataClose.substring(6,8)
						}
						if(photoMainData.lf_availDataStart.indexOf("-") == -1 ){
							photoMainData.lf_availDataStart = photoMainData.lf_availDataStart.substring(0,4) +"-"+photoMainData.lf_availDataStart.substring(4,6)+"-"+photoMainData.ow_availDataStart.substring(6,8);
						}
						if(oldValidity != photoMainData.lf_availDataStart && photoMainData.lf_availDataStart != ''){
							return false;
						}
						
					}else if("BF"==role){
						var bf_availDataStart="";
						var bf_name="";
						var benefitList=photoMainData.benefitList;
						if(benefitList!=null & benefitList!="" && benefitList.length>0){
							for(var i=0;i < benefitList.length;i++){
								bf_name=benefitList[i].name;
								if($scope.curentPtBfName==bf_name){
									bf_availDataStart=benefitList[i].availDataStart;
									break;
								}
							}
						}
						if(oldValidity != bf_availDataStart && bf_availDataStart != ''){
							return false;
						}
						
					}
					return true;
				}
			//S2020120315839_增加记录证件有效期起始日  add by mqz 20210125 end
			
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
			function checkAndSetIdcardInfo(idNo,role,curentPtId,curentPtTypeName,idCardBigPic,curentPtBfName){
//				function checkAndSetIdcardInfo(idNo,name,sex,birthday,role,curentPtId,curentPtTypeName,idCardBigPic,curentPtBfName){
						console.log("queryIdCardInfoByIdNo begin...........");
				//alert("checkAndSetIdcardInfo");
				if(checkFlag10=="Y" && "BF"!=role){
//					if("男"==sex){
//						sex="M";
//					}else{
//						sex="F";
//					}
//					birthday=birthday.replace(/-/g,"");
					if("OW"==role){
						//alert("idNo="+idNo);
						//alert("ow_idNo="+photoMainData.ow_idNo);
						if(idNo!=photoMainData.ow_idNo){
							//setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
							myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认!","info");
							return false;
						}else{
//							if(name==photoMainData.ow_name && sex==photoMainData.ow_sex && birthday==photoMainData.ow_birthday){
								setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//							}else{
//								//setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//								myFactory.alert("","证件信息与客户身份信息不一致，请办理身份信息变更！","info");
//								return false;
//							}
						}
					}else if("LF"==role){
						if(idNo!=photoMainData.lf_idNo){
							myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
							return false;
						}else{
//							if(name==photoMainData.lf_name && sex==photoMainData.lf_sex && birthday==photoMainData.lf_birthday){
								setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//							}else{
//								myFactory.alert("","证件信息与客户身份信息不一致，请办理身份信息变更！","info");
//								return false;
//							}
						}
					}
				}else{
					var isCheckFlag=false;
					if("OW"==role){
						if(idNo==photoMainData.ow_idNo){
							isCheckFlag=true;
						}else{
							myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
							return false;
						}
					}else if("LF"==role){
						if(idNo==photoMainData.lf_idNo){
							isCheckFlag=true;
						}else{
							myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
							return false;
						}
					}else if("BF"==role){
						isCheckFlag=false;//受益人留影界面不需要与后台校验了
						var bf_name="";
						var bf_sex="";
						var bf_idNo="";
						var bf_birthDay="";
//						if("男"==sex){
//							sex="M";
//						}else{
//							sex="F";
//						}
						var benefitList=photoMainData.benefitList;
						if(benefitList!=null & benefitList!="" && benefitList.length>0){
							for(var i=0;i < benefitList.length;i++){
								bf_name=benefitList[i].name;
								/*姓名、name
								性别：sex  F M
								idType 1
								idNo
								birthday 2018-01-01*/
								if(curentPtBfName==bf_name){
//									bf_sex=benefitList[i].sex;
									bf_idNo=benefitList[i].idNo;
//									bf_birthDay=benefitList[i].birthDay;
									break;
								}
							}
						}
						
						if(idNo!=bf_idNo){
							myFactory.alert("","留影证件信息与客户信息/当次变更后信息不一致，请确认！","info");
							return false;
						}else{
//							if(name==bf_name && sex==bf_sex && birthday==bf_birthDay){
								setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//							}else{
//								myFactory.alert("","证件信息与客户身份信息不一致，请办理身份信息变更！","info");
//								return false;
//							}
						}
						
					}
					if(isCheckFlag){
						setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//						var token=sessionStorage.getItem("token");
//						var timestamp=myFactory.getTimetamp();
//						var sfis= "token-timestamp";
//						var signStr="token="+token+"&timestamp="+timestamp;
//						var sign = myFactory.hex(signStr);
//						$http({
//							method: 'GET',
//							url: app.domain + 'common/queryIdCardInfoByIdNo.action',
//							params: {'secuityno':idNo,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
//						}).then(function successCallback(response) {
//							if (response.data.success) {
//								var secuityno = response.data.data.secuityno;
//								if(secuityno != "" && secuityno != null && secuityno != undefined){
//									var surname = response.data.data.surname;
//									var cltsex = response.data.data.cltsex;
//									if("M"==cltsex){
//										cltsex="男";
//									}else{
//										cltsex="女";
//									}
//									var cltdob = response.data.data.cltdob;
//									if("99999999"==cltdob){
//										cltdob="长期";
//									}
//									console.log("secuityno="+secuityno+",surname="+surname+",cltsex="+cltsex+",cltdob="+cltdob);
//									birthday=birthday.replace(/-/g,"");
//									if(name==surname && sex==cltsex && birthday==cltdob){
//										setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//									}else{
//										//setIdCardPic(curentPtId,curentPtTypeName,idCardBigPic);
//										myFactory.alert("","证件信息与客户身份信息不一致，请办理身份信息变更！","info");
//									}
//								}else{
//									myFactory.alert("","证件信息与客户身份信息不一致，请办理身份信息变更！","info");
//								}
//							}
//						}, function errorCallback(response) {
//							console.log("do queryIdCardInfoByIdNo error");
//						});
					}
				}
			}
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
		
			function setIdCardPic(curentPtId,curentPtTypeName,resultImage){
				//设置图片
				$("#img_"+curentPtTypeName+"_"+curentPtId).css('display','inline');
				$("#photo_cover_"+curentPtId).css('display','none');
				$("#text_cover_"+curentPtId).css('display','none');
				$("#img_"+curentPtTypeName+"_"+curentPtId).attr('src','data:image/gif;base64,'+resultImage);
				$("#"+curentPtTypeName+"_"+curentPtId).val(resultImage);
				$("#delImg_"+curentPtId).css('display','inline');
			}
			//S2018051403895_信易通人证合一及活体检测项目需求 add by rqyang 20180711 end
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 start
			/**
			 * 扫描银行卡信息
			 */
			$scope.scanBankCardInfo = function (context_id,typeName) {
				if($scope.isPhotoOpenFlag){
					$scope.isPhotoOpenFlag=false;
					setTimeout(function() {
						$scope.isPhotoOpenFlag=true;
					}, 350);
				}else{
					return false;
				}
				if($("#img_"+typeName+"_"+context_id).attr("src")){
					return false;
				}
				//移动端
				cordova.sino.getBankCardInfo(function(result){
					if(result.success){
						if(!result.data.exit){
							if(appVersion==="IOS"){
								if(result.data.ok){
									var cardNumber=result.data.CardNumber;//卡号									
									var val = result.data.bigPic;//拍照数据
									//alert(CardNumber+","+CardInsName+","+BankCardType);
									cardNumber = cardNumber.replace(/ /g,"");
									var tempNumber = $scope.photoMainData.bankInfoAcc;
									if (cardNumber != tempNumber ){
											myFactory.alert('','留影银行账户信息与当次录入的账户信息不一致，请确认','info');
											return;
									}
									$("#img_"+typeName+"_"+context_id).css('display','inline');
									$("#photo_cover_"+context_id).css('display','none');
									$("#text_cover_"+context_id).css('display','none');
									$("#img_"+typeName+"_"+context_id).attr('src','data:image/gif;base64,'+val);
									$("#"+typeName+"_"+context_id).val(val);
									$("#delImg_"+context_id).css('display','inline');
								} else{
									myFactory.alert('','扫描银行卡信息失败:'+result.data.errormsg,'info');
								}
							}else{
								var val = result.data.bigPic;//拍照数据
								result.data.bigPic="";
								cordova.sino.confirmBankCardInfo(function(result){
									if(result.success){
										if(result.data.ok){
											var cardNumber=result.data.CardNumber;//卡号
											cardNumber = cardNumber.replace(/ /g,"");
												var tempNumber = $scope.photoMainData.bankInfoAcc;
												if (cardNumber != tempNumber ){
													myFactory.alert('','留影银行账户信息与当次录入的账户信息不一致，请确认','info');
													return;
												}
											
											$("#img_"+typeName+"_"+context_id).css('display','inline');
											$("#photo_cover_"+context_id).css('display','none');
											$("#text_cover_"+context_id).css('display','none');
											$("#img_"+typeName+"_"+context_id).attr('src','data:image/gif;base64,'+val);
											$("#"+typeName+"_"+context_id).val(val);
											$("#delImg_"+context_id).css('display','inline');
										}
									}else{
										myFactory.alert('','扫描银行卡信息失败:'+result.data.errormsg,'info');
									}
								},result.data)
							}
						}
					}else{
						//sino.alert("扫描银行卡信息失败:"+result.data.errormsg);
						myFactory.alert('','扫描银行卡信息失败:'+result.data.errormsg,'info');
					}
				}
				/*信易通3.0 S2019012807164信易通OCR识别功能————留影签名页面 银行卡选择扫描或拍照方式调整  yangyan 20190828 start*/
				,{canModify : true}
				/*信易通3.0 S2019012807164信易通OCR识别功能————留影签名页面 银行卡选择扫描或拍照方式调整  yangyan 20190828 end*/
				);
			}//扫描银行卡信息函数END
			
			if(photoMainData.bankInfoImg){
				$("#img_bankPt_506a").css('display','inline');
				$("#photo_cover_506a").css('display','none');
				$("#text_cover_506a").css('display','none');
				$("#img_bankPt_506a").attr('src','data:image/gif;base64,'+photoMainData.bankInfoImg);
				$("#bankPt_506a").val(photoMainData.bankInfoImg);
				$("#delImg_506a").css('display','inline');
			}
			
			//S2019012807164 - 信易通OCR识别功能 add by csf 20190412 end
			
			/*S2019012807164信易通OCR识别功能————留影签名页面 银行卡选择扫描或拍照方式调整  jiyongchang 20190513 start*/
					
			$scope.bankphotoflag = function (context_id,typeName) {
				myFactory.goBankPhotoFlag(bankPhotoSuccess,bankPhotoError); 
			}
			function bankPhotoSuccess(response){
				/*myFactory.alert('','进入response','info');*/
	            var resCode = response.data.returnCode;
	            /*0 使用银行卡拍照（旧）takePictures        1使用银行卡OCR扫描（新）scanBankCardInfo*/
	           /* myFactory.alert('','进入response：'+resCode,'info');*/
	             if ( resCode == '0'){
	            	 $scope.takePictures("506a","bankPt");	            	 
	             }else{
	            	 $scope.scanBankCardInfo("506a","bankPt");	
	            	 
	             }
	        }
	        function bankPhotoError(response){   	
	        	   myFactory.alert("","获取银行卡拍照开关异常，请稍后重试","info");
	               myFactory.loadingHide();
	        	   return;
	       }
			
	        /*S2019012807164信易通OCR识别功能————留影签名页面 银行卡选择扫描或拍照方式调整  jiyongchang 20190513 end*/
	        
	        //S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 start
	        function changeAvailDataStart(dataStart,dataEnd,birthDay){
				dataStart = dataStart.replaceAll('-', '');
				dataEnd=dataEnd.replaceAll('-', '');
				birthDay=birthDay.replaceAll('-', '');
				//计算年龄（有效期起始日-出生日期）
				var age = getTimeDifference(dataStart,birthDay);
				
				//截止日+1天
				var dataEndT = new Date(dataEnd.substring(0,4)+'/'+dataEnd.substring(4,6)+'/'+dataEnd.substring(6,8));
				dataEndT = new Date(dataEndT.getTime() + 24*60*60*1000);
				var endYear = dataEndT.getFullYear();
				var endMonth = dataEndT.getMonth() + 1;  
				var endDay = dataEndT.getDate();
				endMonth = endMonth < 10 ? '0' + endMonth : endMonth;
	            endDay = endDay < 10 ? '0' + endDay : endDay;
				var endMD = endMonth.toString() + endDay.toString();
				var dataEndDateTStr = endYear.toString() + endMD;
				var period = getTimeDifference(dataEndDateTStr,dataStart);
				
				if(age<18){
					if(period!=5){
						return false;
					}
				}else{
					if(period!=10){
						return false;
					}
				}

				var dataStartMD = dataStart.substring(4,8);
				var dataEndMD = dataEnd.substring(4,8);
				if(dataStartMD!="0229" && dataEndMD!="0229"){		
					if(dataStartMD!=dataEndMD && dataStartMD!=endMD){
						return false;
					}				
				}
				return true;
			}

			
			function getTimeDifference(dataStart,dataEnd){         
				var returnYear;  
				
				var dataStart = dataStart.replaceAll('-', '');
				var dataStartYear = dataStart.substring(0,4); 
				var dataStartMonth = dataStart.substring(4,6);   
				var dataStartDay = dataStart.substring(6,8); 
				
				var dataEnd=dataEnd.replaceAll('-', '');
				var dataEndYear = dataEnd.substring(0,4); 
				var dataEndMonth = dataEnd.substring(4,6);
				var dataEndDay = dataEnd.substring(6,8);
				
				if(dataStartYear == dataEndYear){  
					returnYear = 0;//同年
				} else {  
					var yearDiff = dataStartYear - dataEndYear ; //年之差  
					if(yearDiff > 0){  
						if(dataStartMonth == dataEndMonth) {  
							var dayDiff = dataStartDay - dataEndDay;//日之差  
							if(dayDiff < 0) {  
								returnYear = yearDiff - 1;  
							} else {  
								returnYear = yearDiff ;  
							}  
						} else {  
							var monthDiff = dataStartMonth - dataEndMonth;//月之差  
							if(monthDiff < 0) {  
								returnYear = yearDiff - 1;  
							} else {  
								returnYear = yearDiff ;  
							}  
						}  
					} else {  
						returnYear = -1;//返回-1 表示日期输入错误
					}  
				}  
				return returnYear;
			}
			//S2023103127804-粤金办发〔2023〕27号-外国人永久居留身份证规则调整系统需求 upate by huanghk 20231115 end
		}]);

		//指针弹窗
		app.directive('infoid',function(){
			return {
				restrict: 'EA',		//指明指令在DOM里面以什么形式被声明,EA.表示即可以是元素也可以是属性
				templateUrl: 'html/input/content_base_info.html'+app.clearCache,
				replace: true,		//设置解析后，DOM声明的指令是否消失
				link: function(scope,element,attrs){  //链接函数负责注册DOM事件和更新DOM,
					console.log('指令完成');
				}
			}
		});
		
		//S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 start
		String.prototype.replaceAll = function(s1, s2) {
			return this.replace(new RegExp(s1, "gm"), s2);
		}
	} catch (e) {
		console.log(e);
	}
	
		//S2020120315839_增加记录证件有效期起始日  add by huanghaokun 20210719 end

		
})(app)